underscore

underscore()
Instance Public methods

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.

1
2
'ActiveModel'.underscore         # => "active_model"
'ActiveModel::Errors'.underscore # => "active_model/errors"
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.