class String
def underscore
"ActiveRecord::Errors".underscore # => active_record/errors
"ActiveRecord".underscore # => "active_record"
+underscore+ will also change '::' to '/' to convert namespaces to paths.
The reverse of +camelize+. Makes an underscored, lowercase form from the expression in the string.
#
def underscore ActiveSupport::Inflector.underscore(self) end