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:
commit
4fdb180516
1 changed files with 17 additions and 15 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue