Method: Extlib::Inflection.humanize
- Defined in:
- lib/extlib/inflection.rb
.humanize(lower_case_and_underscored_word) ⇒ Object
Capitalizes the first word and turns underscores into spaces and strips _id. Like titleize, this is meant for creating pretty output.
55 56 57 |
# File 'lib/extlib/inflection.rb', line 55 def humanize(lower_case_and_underscored_word) lower_case_and_underscored_word.to_s.gsub(/_id$/, '').tr('_', ' ').capitalize end |