Sha256: 80ff571b00701367984431b02aa76d560b7b93d687cc181282cc55db06a27cf2

Contents?: true

Size: 1.51 KB

Versions: 18

Compression:

Stored size: 1.51 KB

Contents

<%%= title t("<%= singular_table_name %>", scope: "activerecord.models").pluralize %>

<%% content_for :right do -%>
  <li class="active">
    <%%= link_to t("new_<%= singular_table_name %>"), new_<%= singular_table_name %>_path %>
  </li>
<%% end -%>

<table class="table table-striped">
  <thead>
    <tr>
      <th><%%= sort_link @search, :id, t(:id, scope: "activerecord.attributes") %></th>
      <% attributes.each do |attribute| -%>
<th><%%= sort_link @search, :<%= attribute.name %>, t(:<%= attribute.name %>, scope: "activerecord.attributes.<%= singular_table_name %>") %></th>
      <% end -%>
<th colspan="3"></th>
    </tr>
  </thead>

  <tbody>

    <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
      <tr>
        <td><%%= <%= singular_table_name %>.id %></td>
<% attributes.each do |attribute| -%>
        <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
<% end -%>
        <td>
          <%%= link_to <%= singular_table_name %> do %>
            <i class="fa fa-file"></i>
          <%% end -%>
        </td>
        <td>
          <%%= link_to edit_<%= singular_table_name %>_path(<%= singular_table_name %>) do %>
            <i class="fa fa-edit"></i>
          <%% end -%>
        </td>
        <td>
          <%%= link_to <%= singular_table_name %>, method: :delete, data: { confirm: t(:are_you_sure) } do %>
            <i class="fa fa-trash"></i>
          <%% end -%>
        </td>
      </tr>
    <%% end %>
  </tbody>
</table>

<br>

<%%= will_paginate @<%= plural_table_name %> %>

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
mechanize_store-0.0.19 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.18 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.17 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.16 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.15 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.14 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.13 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.12 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.11 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.10 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.8 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.7 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.6 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.5 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.4 lib/templates/erb/scaffold/index.html.erb
mechanize_store-0.0.3 lib/templates/erb/scaffold/index.html.erb
mechanize-store-0.0.2 lib/templates/erb/scaffold/index.html.erb
mechanize-store-0.0.1 lib/templates/erb/scaffold/index.html.erb