Method: ExtlibCopy::Inflection.humanize

Defined in:
lib/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.

Examples:

"employee_salary" #=> "Employee salary"
"author_id" #=> "Author"


84
85
86
# File 'lib/inflection.rb', line 84

def humanize(lower_case_and_underscored_word)
  lower_case_and_underscored_word.to_s.gsub(/_id$/, '').tr('_', ' ').capitalize
end