% name_attribute = attributes.find{ |a| a.name == "name" } %> <% has_name = !!name_attribute %>
Name | <% end %> <% attributes.without(name_attribute).each do |attribute| -%><%= attribute.human_name %> | <% end -%> <% unless has_name %><% end %> | <%%= link_to <%= singular_table_name %>.name, <%= singular_table_name %> %> | <% end %> <% attributes.without(name_attribute).each do |attribute| -%><%%= <%= singular_table_name %>.<%= attribute.name %> %> | <% end -%> <% unless has_name %><%%= link_to 'Show', <%= singular_table_name %> %> | <% end %> <%% end %> <%% end %>
---|