instance method
humanize
Ruby on Rails 3.1.12
Since v3.0.20Signature
humanize()
Capitalizes the first word, turns underscores into spaces, and strips ‘_id’. Like titleize, this is meant for creating pretty output.
"employee_salary" # => "Employee salary" "author_id" # => "Author"
Source
# File activesupport/lib/active_support/core_ext/string/inflections.rb, line 149
def humanize
ActiveSupport::Inflector.humanize(self)
end
Defined in activesupport/lib/active_support/core_ext/string/inflections.rb line 149
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in String