Sha256: f3a965675ff57b1ff12b17de202f3d55162421c498b241f144f996d11e30ce59

Contents?: true

Size: 1.39 KB

Versions: 2

Compression:

Stored size: 1.39 KB

Contents

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

<%% if @<%= plural_table_name %>.any? %>
  <table>
    <thead>
      <tr>
<%- attributes.reject(&:password_digest?).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.reject(&:password_digest?).each do |attribute| -%>
  <%- if attribute.type == :integer or attribute.type == :decimal -%>
        <td><%%= number_with_delimiter <%= singular_table_name %>.<%= attribute.name %> %></td>
  <%- else -%>
        <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
  <%- end -%>
<%- end -%>
        <td><%%= link_to 'Mostrar', <%= singular_table_name %> %></td>
        <td><%%= link_to 'Editar', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %></td>
        <td><%%= link_to 'Eliminar', <%= singular_table_name %>, method: :delete, data: { confirm: '¿Estás seguro?' } %></td>
      </tr>
  <%% end %>
    </tbody>
  </table>
<%% else %>
  <div>
    <h3>No se encontraron <%= plural_table_name.humanize %></h3>
  </div>
<%% end %>

<br />
<%- nuevo_str = (singular_table_name.split('_').first =~ /[ad]$/) ? 'Nueva' : 'Nuevo' -%>
<%%= link_to <%= %{"#{nuevo_str} #{human_name}", new_#{singular_table_name}_path} %> %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rieles-0.0.8 lib/templates/erb/scaffold/index.html.erb
rieles-0.0.7 lib/templates/erb/scaffold/index.html.erb