dom_class

dom_class(record_or_class, prefix = nil)
Instance Public methods

The DOM class convention is to use the singular form of an object or class.

1
2
dom_class(post)   # => "post"
dom_class(Person) # => "person"

If you need to address multiple instances of the same class in the same view, you can prefix the #dom_class:

1
2
dom_class(post, :edit)   # => "edit_post"
dom_class(Person, :edit) # => "edit_person"
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.