module ActiveSupport::Inflector
def singularize(word, locale = :en)
singularize('CamelOctopi') # => "CamelOctopus"
singularize('word') # => "word"
singularize('sheep') # => "sheep"
singularize('octopi') # => "octopus"
singularize('posts') # => "post"
this parameter is set to :en.
singularized using rules defined for that language. By default,
If passed an optional +locale+ parameter, the word will be
string.
The reverse of #pluralize, returns the singular form of a word in a
def singularize(word, locale = :en) apply_inflections(word, inflections(locale).singulars, locale) end