Sha256: 0c609eb87b9b448405217d4eda8c794a56c53325524094908b4f03af3c43a2cc

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

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

- if @<%= plural_table_name %>.any?
  %table
    %thead
      %tr
  <%- attributes.each do |attribute| -%>
        %th <%= attribute.human_name %>
  <%- end -%>
        %th
        %th
        %th

    %tbody
      - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
        %tr
  <%- attributes.each do |attribute| -%>
    <%- if attribute.type == :integer or attribute.type == :decimal -%>
          %td= number_with_delimiter <%= singular_table_name %>.<%= attribute.name %>
    <%- else -%>
          %td= <%= singular_table_name %>.<%= attribute.name %>
    <%- end -%>
  <%- end -%>
          %td= link_to 'Mostrar', <%= singular_table_name %>
          %td= link_to 'Editar', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
          %td= link_to 'Eliminar', <%= singular_table_name %>, <%= key_value :method, ":delete" %>, <%= key_value :data, "{ #{key_value :confirm, "'¿Estás seguro?'"} }" %>
- else
  %div
    %h3 No se encontraron <%= plural_table_name.humanize %>

%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

1 entries across 1 versions & 1 rubygems

Version Path
rieles-0.0.5 lib/templates/haml/scaffold/index.html.haml