RecordIdentificationHelper
These methods make it easier for views to identify components referring to Rails objects when building HTML or RJS:
dom_class
Creates a value suitable for a
class
attribute that is the singular form of the object name.dom_id
Creates a value suitable for an
id
attribute that is the singular form of the object name plus_
and the objectâsid
value.partial_path
Creates a value containing
plural/singular
form of an objectâs name, liketurtles/turtle
orpeople/person
.
Get Learning Rails now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.