Sha256: a7703d0bdaac492fe6a2ed93dd388605f9647f26825cf917e6540f6a1bccb7de

Contents?: true

Size: 1.43 KB

Versions: 22

Compression:

Stored size: 1.43 KB

Contents

<%%= render partial: 'contour/layouts/per_page', locals: { per_page: 40, object_count: @<%= resource_name_plural %>.total_count } %>

<table class="table table-striped">
  <thead>
    <tr>
      <%- columns.each do |column| -%>
      <th style="white-space:nowrap"><%%== sort_field_helper(@order, '<%= resource_name_plural %>.<%= column.name %>', '<%= column.name.titleize %>') %></th>
      <%- end -%>
      <th>Actions</th>
    </tr>
  </thead>

  <%% @<%= resource_name_plural %>.each do |<%= resource_name %>| %>
    <tr>
      <%- columns.each do |column| -%>
      <%- if column.name.split('_').last == 'id' -%>
      <td><%%= link_to <%= resource_name %>.<%= column.name.split('_')[0..-2].join('_') %>.name, <%= resource_name %>.<%= column.name.split('_')[0..-2].join('_') %> if <%= resource_name %>.<%= column.name.split('_')[0..-2].join('_') %> %></td>
      <%- else -%>
      <td><%%= <%= resource_name %>.<%= column.name %> %></td>
      <%- end -%>
      <%- end -%>
      <td>
        <%%= link_to 'Edit', edit_<%= resource_name %>_path(<%= resource_name %>), class: 'btn btn-xs btn-default' %>
        <%%= link_to 'Delete', <%= resource_name %>, method: :delete, class: 'btn btn-xs btn-danger-inverse', data: { confirm: "Are you sure you want to delete <%= resource_title %> #{<%= resource_name %>.name}?" } %>
      </td>
    </tr>
  <%% end %>
</table>

<div class="center"><%%= paginate @<%= resource_name_plural %>, theme: 'contour' %></div>

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
contour-3.0.1 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-3.0.1.rc lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-3.0.0 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-3.0.0.rc lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-3.0.0.beta1 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.7.0 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.7.0.beta1 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.6.0 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.6.0.rc lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.6.0.beta8 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.6.0.beta7 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.6.0.beta6 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.6.0.beta5 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.6.0.beta4 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.6.0.beta3 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.6.0.beta2 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.6.0.beta1 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.5.0 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.5.0.beta1 lib/generators/contour/scaffold/templates/_paginate.html.erb
contour-2.4.0 lib/generators/contour/scaffold/templates/_paginate.html.erb