instance method
underscore
Ruby on Rails 8.1.2
Since v3.0.20Signature
underscore()
The reverse of camelize. Makes an underscored, lowercase form from the expression in the string.
underscore will also change ‘::’ to ‘/’ to convert namespaces to paths.
'ActiveModel'.underscore # => "active_model" 'ActiveModel::Errors'.underscore # => "active_model/errors"
See ActiveSupport::Inflector.underscore.
Source
# File activesupport/lib/active_support/core_ext/string/inflections.rb, line 139
def underscore
ActiveSupport::Inflector.underscore(self)
end
Defined in activesupport/lib/active_support/core_ext/string/inflections.rb line 139
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in String