Sha256: ec205e1e099792633c97926d626e12ef6a7908d106807701e749d26e50ec7a9f

Contents?: true

Size: 1.57 KB

Versions: 26

Compression:

Stored size: 1.57 KB

Contents

<h1><%= plural_table_name.humanize %></h1>

<% if named_routes? -%>
<p><%%= link_to 'Add a New <%= human_name.titleize %>', new_<%= singular_table_name %>_url %></p>
<% else -%>
<p><%%= link_to 'Add a New <%= human_name.titleize %>', "/<%= plural_name %>/new" %></p>
<% 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 %><%= "?" if attribute.type == :boolean %> %></td>
  <% end -%>
<% if named_routes? %>
      <td><%%= link_to 'Show', <%= singular_table_name %>_url(<%= singular_table_name %>) %></td>
      <td><%%= link_to 'Edit', edit_<%= singular_table_name %>_url(<%= singular_table_name %>) %></td>
      <td><%%= link_to 'Destroy', <%= singular_table_name %>_url(<%= singular_table_name %>), method: 'delete', data: { confirm: "Do you really want to delete this <%= singular_table_name %>?" } %></td>
<% else %>
      <td><%%= link_to 'Show', "/<%= plural_name %>/#{<%= singular_table_name %>.id}" %></td>
      <td><%%= link_to 'Edit', "/<%= plural_name %>/#{<%= singular_table_name %>.id}/edit" %></td>
      <td><%%= link_to 'Destroy', "/<%= plural_name %>/#{<%= singular_table_name %>.id}", method: 'delete', data: { confirm: "Do you really want to delete this <%= singular_table_name %>?" } %></td>
<% end %>
    </tr>
  <%% end %>
  </tbody>
</table>

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
ez-1.3.0 lib/generators/ez/resource/templates/dried/index.html.erb
ez-1.2.0 lib/generators/ez/resource/templates/dried/index.html.erb
ez-1.1.3 lib/generators/ez/resource/templates/dried/index.html.erb
ez-1.1.2 lib/generators/ez/resource/templates/dried/index.html.erb
ez-1.1.1 lib/generators/ez/resource/templates/dried/index.html.erb
ez-1.1.0 lib/generators/ez/resource/templates/dried/index.html.erb
ez-1.0.0 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.9.9 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.9.7 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.9.6 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.9.5 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.9.1 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.9.0 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.8.7 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.8.6 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.7.0 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.6.5 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.6.4 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.6.3 lib/generators/ez/resource/templates/dried/index.html.erb
ez-0.6.2 lib/generators/ez/resource/templates/dried/index.html.erb