Type:
Module
Constants:
JOIN : '_'.freeze
NEW : 'new'.freeze

The record identifier encapsulates a number of naming conventions for dealing with records, like Active Records or pretty much any other model type that has an id. These patterns are then used to try elevate the view actions to a higher logical level.

# routes
resources :posts

# view
<%= div_for(post) do %>    <div id="post_45" class="post">
  <%= post.body %>           What a wonderful world!
<% end %>                  </div>

# controller
def update
  post = Post.find(params[:id])
  post.update(params[:post])

  redirect_to(post) # Calls polymorphic_url(post) which in turn calls post_url(post)
end

As the example above shows, you can stop caring to a large extent what the actual id of the post is. You just know that one is being assigned and that the subsequent calls in redirect_to expect that same naming convention and allows you to write less code if you follow it.

record_key_for_dom_id

record_key_for_dom_id(record) Instance Protected methods Returns a string representation

2015-06-20 00:00:00
dom_class

dom_class(record_or_class, prefix = nil) Instance Public methods The DOM class

2015-06-20 00:00:00
dom_id

dom_id(record, prefix = nil) Instance Public methods The DOM id convention is

2015-06-20 00:00:00