convert_to_model

convert_to_model(object) Instance Public methods Converts the given object to an ActiveModel compliant one.

model_name_from_record_or_class

model_name_from_record_or_class(record_or_class) Instance Public methods

query

query(path, exts, formats) Instance Public methods

new

new(*) Class Public methods

render

render(context, options, block) Instance Public methods

render_collection

render_collection() Instance Public methods

render_partial

render_partial() Instance Public methods

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. 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: dom_class(post, :edit) # => "edit_post" dom_class(Person, :edit) # => "edit_person"

dom_id

dom_id(record, prefix = nil) Instance Public methods The DOM id convention is to use the singular form of an object or class with the id following an underscore. If no id is found, prefix with ânew_â instead. dom_id(Post.find(45)) # => "post_45" dom_id(Post.new) # => "new_post" If you need to address multiple instances of the same class in the same view, you can prefix the #dom_id: dom_id(Post.find(45), :edit) # => "edit_post_45" dom_id(Post.new, :custom)

record_key_for_dom_id

record_key_for_dom_id(record) Instance Protected methods Returns a string representation of the key attribute(s) that is suitable for use in an HTML DOM id. This can be overwritten to customize the default generated string representation if desired. If you need to read back a key from a #dom_id in order to query for the underlying database record, you should write a helper like 'person_record_from_dom_id' that will extract the key either based on the default implementation (which j