diff --git a/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb b/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb index 303331a4f0a455f788b7da28150dd065b4275867..d78d97b2b4dcc1ef40e2ef0550a28c0be2804635 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb +++ b/railties/lib/rails/generators/erb/scaffold/templates/index.html.erb @@ -1,23 +1,27 @@
<%= attribute.human_name %> | -<% end -%> -- | - | - |
---|---|---|---|
<%= attribute.human_name %> | + <% end -%> ++ | + | + | <%%= <%= singular_table_name %>.<%= attribute.name %> %> | -<% end -%> -<%%= link_to 'Show', <%= singular_table_name %> %> | -<%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %> | -<%%= link_to 'Destroy', <%= singular_table_name %>, confirm: 'Are you sure?', method: :delete %> | - <%% end %> + + <%%= content_tag_for(:tr, @<%= plural_table_name %>) do |<%= singular_table_name %>| %> + <% attributes.each do |attribute| -%> +<%%= <%= singular_table_name %>.<%= attribute.name %> %> | + <% end -%> +<%%= link_to 'Show', <%= singular_table_name %> %> | +<%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %> | +<%%= link_to 'Destroy', <%= singular_table_name %>, confirm: 'Are you sure?', method: :delete %> | + <%% end %> +