No commit activity in last 3 years
No release in over 3 years
Adds a literal method to Rails 3 inflections
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme
InflectorLiterals
=================

When you call String#humanize, it calls capitalize on the result. This means that something like "ip_address".humanize returns "Ip address" instead of "IP address".

I added a method to ActiveSupport::Inflector::Inflections called literal, that lets you specify exactly what humans expect to read for a field name.

Example
=======

in inflections.rb:

ActiveSupport::Inflector.inflections do |inflect|
    inflect.literal "po_number", "PO number"
end

Thenceforth:

"po_number".humanize ==> "PO number"

Copyright (c) 2010 Ross Andrews, released under the MIT license