Sha256: 6b3b625cbff0ce310cfb340f5a56907db581319fae5bd9bfc43306765ff168c9
Contents?: true
Size: 1.99 KB
Versions: 26
Compression:
Stored size: 1.99 KB
Contents
<div class="page-header"> <h1><%= plural_table_name.humanize %></h1> </div> <% if named_routes? -%> <p><%%= link_to 'Add a New <%= human_name.titleize %>', new_<%= singular_table_name %>_url, class: 'btn btn-primary' %></p> <% else -%> <p><%%= link_to 'Add a New <%= human_name.titleize %>', "/<%= plural_name %>/new", class: 'btn btn-primary' %></p> <% end -%> <table class="table table-hover"> <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 '<i class="fa fa-search-plus"></i>'.html_safe, <%= singular_table_name %>_url(<%= singular_table_name %>), class: 'btn btn-primary' %></td> <td><%%= link_to '<i class="fa fa-edit"></i>'.html_safe, edit_<%= singular_table_name %>_url(<%= singular_table_name %>), class: 'btn btn-warning' %></td> <td><%%= link_to '<i class="fa fa-trash-o"></i>'.html_safe, <%= singular_table_name %>_url(<%= singular_table_name %>), method: 'delete', data: { confirm: "Do you really want to delete this <%= singular_table_name %>?" }, class: 'btn btn-danger' %></td> <% else %> <td><%%= link_to '<i class="fa fa-search-plus"></i>'.html_safe, "/<%= plural_name %>/#{<%= singular_table_name %>.id}", class: 'btn btn-primary' %></td> <td><%%= link_to '<i class="fa fa-edit"></i>'.html_safe, "/<%= plural_name %>/#{<%= singular_table_name %>.id}/edit", class: 'btn btn-warning' %></td> <td><%%= link_to '<i class="fa fa-trash-o"></i>'.html_safe, "/<%= plural_name %>/#{<%= singular_table_name %>.id}", method: 'delete', data: { confirm: "Do you really want to delete this <%= singular_table_name %>?" }, class: 'btn btn-danger' %></td> <% end %> </tr> <%% end %> </tbody> </table>
Version data entries
26 entries across 26 versions & 2 rubygems