Permalink
Browse files

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>
  • Loading branch information...
1 parent 4746f92 commit e62f4404cf35e1606def6853b4450068f0ebc2cb @carlosantoniodasilva carlosantoniodasilva committed Apr 18, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 railties/lib/rails/generators/erb/scaffold/templates/index.html.erb
View
4 railties/lib/rails/generators/erb/scaffold/templates/index.html.erb
@@ -15,9 +15,9 @@
<tbody>
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
<tr>
- <% attributes.reject(&:password_digest?).each do |attribute| -%>
+<% attributes.reject(&:password_digest?).each do |attribute| -%>
<td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
- <% end -%>
+<% end -%>
<td><%%= link_to 'Show', <%= 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>

0 comments on commit e62f440

Please sign in to comment.