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’s id value.

partial_path

Creates a value containing plural/singular form of an object’s name, like turtles/turtle or people/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.