Method: ActiveSupport::Inflector#pluralize

Defined in:
activesupport/lib/active_support/inflector/methods.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.

pluralize('post')             # => "posts"
pluralize('octopus')          # => "octopi"
pluralize('sheep')            # => "sheep"
pluralize('words')            # => "words"
pluralize('CamelOctopus')     # => "CamelOctopi"
pluralize('ley', :es)         # => "leyes"


33
34
35
# File 'activesupport/lib/active_support/inflector/methods.rb', line 33

def pluralize(word, locale = :en)
  apply_inflections(word, inflections(locale).plurals, locale)
end