Sha256: 7ca5bb740c5599679cb3b2aa68d9b8b46e0504ce523b80e13ed9ef725d9ea126

Contents?: true

Size: 1.42 KB

Versions: 2

Compression:

Stored size: 1.42 KB

Contents

<%% title("<%= plural_table_name.titleize %>") %>
<p>
  <%%= link_to(new_<%= singular_table_name %>_path, :class => 'btn btn-success') do %>
    <i class="icon-plus icon-white"></i> New <%= singular_table_name %>
  <%% end %>
</p>

<table class="table table-bordered table-striped">
  <thead>
    <tr>
      <th>ID</th>
      <%- unless attributes.empty? -%>
      <th><%= attributes.first.human_name.titleize %></th>
      <%- end -%>
      <th>Created at</th>
      <th class="actions">Actions</th>
    </tr>
  </thead>
  <tbody>
    <%%= content_tag_for(:tr, @<%= plural_table_name %>) do |<%= singular_table_name %>| %>
      <td>#<%%= <%= singular_table_name %>.id %></td>
      <%- unless attributes.empty? -%>
      <td><strong><%%= link_to("#{<%= singular_table_name %>.<%= attributes.first.name %>}", <%= singular_table_name %>) %></strong></td>
      <% end -%>
      <td><%%= <%= singular_table_name %>.created_at %></td>
      <td class="actions">
        <%%= link_to(edit_<%= singular_table_name %>_path(<%= singular_table_name %>), :class => 'btn btn-mini btn-primary') do %>
          <i class="icon-edit icon-white"></i> Edit
        <%% end %>
        <%%= link_to(<%= singular_table_name %>, :confirm => 'Are you sure?', :method => :delete, :class => 'btn btn-mini btn-danger') do %>
         <i class="icon-remove icon-white"></i> Delete
        <%% end %>
      </td>
    <%% end %>
   </tbody>
</table>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flexi_generators-0.3.3 lib/generators/flexi/scaffold/templates/index.html.erb
flexi_generators-0.3.2 lib/generators/flexi/scaffold/templates/index.html.erb