method
humanize
v2.0.3 -
Show latest stable
-
2 notes -
Class: Inflector
- 1.0.0 (0)
- 1.1.6 (0)
- 1.2.6 (33)
- 2.0.3 (0)
- 2.1.0 (5)
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
humanize(lower_case_and_underscored_word)
public
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"
Register or
log in
to add new notes.
grosser -
October 25, 2008
3 thanks
Also for numeric
1.humanize == “1″ 1000000.humanize == “1.000.000″ 1000.12345.humanize == “1.000,12″
http://pragmatig.wordpress.com/2008/10/25/numbers-for-humans-humanize-for-numeric/
clescuyer -
September 24, 2009 - (>= v2.2.1)
0 thanks
This method has been moved
This method has been moved to ActiveSupport::Inflector#humanize