instance method
humanize
Ruby on Rails 4.0.13
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'.humanize # => "Employee salary" 'author_id'.humanize # => "Author"
Source
# File activesupport/lib/active_support/core_ext/string/inflections.rb, line 198
def humanize
ActiveSupport::Inflector.humanize(self)
end
Defined in activesupport/lib/active_support/core_ext/string/inflections.rb line 198
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in String