instance method
singularize
Ruby on Rails 3.2.22.5
Since v2.2.3Signature
singularize(word)
The reverse of pluralize, returns the singular form of a word in a string.
Examples:
"posts".singularize # => "post" "octopi".singularize # => "octopus" "sheep".singularize # => "sheep" "word".singularize # => "word" "CamelOctopi".singularize # => "CamelOctopus"
Parameters
-
wordreq
Source
# File activesupport/lib/active_support/inflector/methods.rb, line 36
def singularize(word)
apply_inflections(word, inflections.singulars)
end
Defined in activesupport/lib/active_support/inflector/methods.rb line 36
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Inflector