Sha256: 79ee254ac8ef75a7929f0fc994a4c8d2aeac6d03fc0f0ba4bbc858048a798ac8

Contents?: true

Size: 1.66 KB

Versions: 2

Compression:

Stored size: 1.66 KB

Contents

<a class="btn-floating btn-large waves-effect waves-light red" href="<%%= new_admin_<%=singular_table_name%>_path %>" style="float:right;"><i class="material-icons">add</i></a>

<h2><%= plural_table_name.titleize %></h2>

<!-- filtering section - to be created customizing index -->
<%%= search_form_for @q, url: admin_<%=plural_table_name%>_path do |f| %>
<div class="row">
  <div class="col s3 input-field">
    <%%= f.label <%= ":id_cont" %> %>
    <%%= f.search_field <%=  ":id_cont" %> %> 
  </div>
</div>
 <div class="row">
   <div class="col">
    <%%= f.submit class: 'btn waves-effect waves-light' %>
    <%% if params[:q].present? %>
     <a href="<%%= admin_<%=plural_table_name %>_path %>" class="btn waves-effect waves-light purple darken-4">RESET</a>
    <%% end %>
   </div>
 </div>
<%% 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 -%>
        <td><%%= link_to 'Show', <%= "[:#{prefix}, #{singular_table_name}]" %> %></td>
        <td><%%= link_to 'Edit', edit_<%= prefixed_plain_model_url %>_path(<%= singular_table_name %>) %></td>
        <td><%%= link_to 'Destroy', <%= "[:#{prefix}, #{singular_table_name}]" %>, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <%% end %>
  </tbody>
</table>

<br>

<%%= link_to 'New <%= human_name %>', new_<%= prefixed_plain_model_url %>_path %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
material_admin-0.0.2 lib/generators/admin/scaffold_controller/templates/views/erb/index.html.erb.erb
material_admin-0.0.1 lib/generators/admin/scaffold_controller/templates/views/erb/index.html.erb.erb