Get DOM-friendly IDs from your Rails objects
Another new article in Bruce's series shows you how to get DOM-friendly IDs from ActiveRecord. This is a solution nearly all Rails developers have implemented at some time or another:
<ul> <% @entries.each do |entry| %> <li id='journal-entry-<%= entry.id %>'> <%= entry.body %> </li> <% end %> </ul>
But Bruce demonstrates a cleaner way..