Method: Frontline::Inflector#pluralize
- Defined in:
- lib/frontline/inflect.rb
#pluralize(word, locale = :en) ⇒ Object
Returns the plural form of the word in the string.
If passed an optional locale parameter, the word will be pluralized using rules defined for that language. By default, this parameter is set to :en.
'post'.pluralize # => "posts"
'octopus'.pluralize # => "octopi"
'sheep'.pluralize # => "sheep"
'words'.pluralize # => "words"
'CamelOctopus'.pluralize # => "CamelOctopi"
'ley'.pluralize(:es) # => "leyes"
134 135 136 |
# File 'lib/frontline/inflect.rb', line 134 def pluralize(word, locale = :en) apply_inflections(word, inflections(locale).plurals) end |