Skip to content

Commit ba5a334

Browse files
committed
Use content_tag_for with array by default on scaffold.
1 parent 345ac29 commit ba5a334

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

railties/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Rails 4.0.0 (unreleased) ##
22

3+
* Scaffold now uses `content_tag_for` in index.html.erb *José Valim*
4+
35
* Rails::Plugin has gone. Instead of adding plugins to vendor/plugins use gems or bundler with path or git dependencies. *Santiago Pastorino*
46

57
## Rails 3.2.0 (unreleased) ##
@@ -67,7 +69,7 @@
6769
config/initializers/* will not be executed.
6870

6971
Plugins developers need to special case their initializers that are
70-
meant to be run in the assets group by adding :group => :assets.
72+
meant to be run in the assets group by adding :group => :assets.
7173

7274
## Rails 3.1.0 (August 30, 2011) ##
7375

railties/lib/rails/generators/erb/scaffold/templates/index.html.erb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@
1010
<th></th>
1111
</tr>
1212

13-
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
14-
<tr>
13+
<%%= content_tag_for(:tr, @<%= plural_table_name %>) do |<%= singular_table_name %>| %>
1514
<% attributes.each do |attribute| -%>
1615
<td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
1716
<% end -%>
1817
<td><%%= link_to 'Show', <%= singular_table_name %> %></td>
1918
<td><%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %></td>
2019
<td><%%= link_to 'Destroy', <%= singular_table_name %>, <%= key_value :confirm, "'Are you sure?'" %>, <%= key_value :method, ":delete" %> %></td>
21-
</tr>
22-
<%% end %>
20+
<%% end %>
2321
</table>
2422

2523
<br />

0 commit comments

Comments
 (0)