File: index.html.haml

package info (click to toggle)
ruby-haml-rails 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 228 kB
  • sloc: ruby: 281; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 712 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
%h1 Listing <%= plural_table_name %>

%table
  %thead
    %tr
<% for attribute in attributes -%>
      %th <%= attribute.human_name %>
<% end -%>
      %th
      %th
      %th

  %tbody
    - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
      %tr
<% for attribute in attributes -%>
        %td= <%= singular_table_name %>.<%= attribute.name %>
<% end -%>
        %td= link_to 'Show', <%= singular_table_name %>
        %td= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
        %td= link_to 'Destroy', <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' }

%br

= link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path