instance method
humanize
Ruby on Rails 3.2.22.5
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 187
def humanize
ActiveSupport::Inflector.humanize(self)
end
Defined in activesupport/lib/active_support/core_ext/string/inflections.rb line 187
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in String