Sha256: ec205e1e099792633c97926d626e12ef6a7908d106807701e749d26e50ec7a9f
Contents?: true
Size: 1.57 KB
Versions: 26
Compression:
Stored size: 1.57 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 %><%= "?" if attribute.type == :boolean %> %></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