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

Unindent attributes iteration in scaffold index template

Otherwise we get extra indent for the <td> elements due to the extra
spaces at the beginning of the lines, like this:

      <tr>
          <td><%= author.name %></td>
          <td><%= link_to 'Show', author %></td>
        <td><%= link_to 'Edit', edit_author_path(author) %></td>
This commit is contained in:
Carlos Antonio da Silva 2013-04-18 16:01:31 -03:00
parent 4746f92b13
commit e62f4404cf

View file

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