Sha256: 734d9ec8caad4f7e7ec182d36058fb785ba117951fdc33e3a625c4deae391343

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

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

<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 %> %></td>
<%% end -%>
<%- if options.cancan? -%>
      <td><%%%= link_to 'Mostrar', <%%= singular_table_name %> if can? :read, @<%%= singular_table_name %> %></td>
      <td><%%%= link_to 'Editar', edit_<%%= singular_table_name %>_path(<%%= singular_table_name %>) if can? :update, @<%%= singular_table_name %> %></td>
      <td><%%%= link_to 'Eliminar', <%%= singular_table_name %>, <%%= key_value :confirm, "'¿Está usted seguro?'" %>, <%%= key_value :method, ":delete" %> if can? :destroy, @<%%= singular_table_name %> %></td>
<%- else -%>
      <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 %>, <%%= key_value :confirm, "'¿Está usted seguro?'" %>, <%%= key_value :method, ":delete" %> %></td>
<%- end -%>
    </tr>
  <%%% end %>
  </tbody>
</table>

<br />
<%% nuevo = singular_table_name.split('_').first.ends_with?("a") ? 'Nueva' : 'Nuevo' -%>
<%%%= link_to '<%%= nuevo %> <%%= human_name %>', new_<%%= singular_table_name %>_path %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lbs-config-0.0.2 lib/generators/lbs/install/templates/index.html.erb