1
0
Fork 0
mirror of https://github.com/haml/haml-rails.git synced 2022-11-09 12:34:15 -05:00

Merge pull request #63 from beautyfree/patch-1

Add "tparts" for table in scaffold
This commit is contained in:
André Arko 2014-01-02 15:49:09 -08:00
commit 4fdb180516

View file

@ -1,22 +1,24 @@
%h1 Listing <%= plural_table_name %>
%table
%tr
<% for attribute in attributes -%>
%th <%= attribute.human_name %>
<% end -%>
%th
%th
%th
- @<%= plural_table_name %>.each do |<%= singular_table_name %>|
%thead
%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?' }
<% 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