Sha256: 05462fda223b3315659e6f48731bb88a661296a3e06b0098bbdd56747d58d613
Contents?: true
Size: 1.53 KB
Versions: 26
Compression:
Stored size: 1.53 KB
Contents
<h1><%= plural_table_name.humanize %></h1> <% if named_routes? -%> <p><%%= link_to 'Add a New <%= human_name.titleize %>', new_<%= singular_table_name %>_url %></p> <% else -%> <p><%%= link_to 'Add a New <%= human_name.titleize %>', "/<%= plural_name %>/new" %></p> <% end -%> <table> <thead> <tr> <% attributes.each do |attribute| -%> <th><%= attribute.human_name %></th> <% end -%> <th></th> <th></th> <th></th> </tr> </thead> <tbody> <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %> <tr> <% attributes.each do |attribute| -%> <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td> <% end -%> <% if named_routes? -%> <td><%%= link_to 'Show', <%= singular_table_name %>_url(<%= singular_table_name %>) %></td> <td><%%= link_to 'Edit', edit_<%= singular_table_name %>_url(<%= singular_table_name %>) %></td> <td><%%= link_to 'Destroy', <%= singular_table_name %>_url(<%= singular_table_name %>), method: 'delete', data: { confirm: "Do you really want to delete this <%= singular_table_name %>?" } %></td> <% else -%> <td><%%= link_to 'Show', "/<%= plural_name %>/#{<%= singular_table_name %>.id}" %></td> <td><%%= link_to 'Edit', "/<%= plural_name %>/#{<%= singular_table_name %>.id}/edit" %></td> <td><%%= link_to 'Destroy', "/<%= plural_name %>/#{<%= singular_table_name %>.id}", method: 'delete', data: { confirm: "Do you really want to delete this <%= singular_table_name %>?" } %></td> <% end -%> </tr> <%% end %> </tbody> </table>
Version data entries
26 entries across 26 versions & 2 rubygems