I\'m running Rails 2.3.2.
How do I convert \"Cool\" to \"cool\"? I know \"Cool\".downcase works, but is there a Ruby/Rails method
\"Cool\"
\"cool\"
\"Cool\".downcase
There is no real inverse of capitalize, but I think underscore comes close.
underscore
"CoolCat".underscore #=> "cool_cat" "cool_cat".capitalize #=> "Cool_cat" "cool_cat".camelize #=> "CoolCat"
Edit: underscore is of course the inverse of camelize, not capitalize.
camelize
capitalize