Browse files

Update scaffolding [#1840 state:committed]

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
  • Loading branch information...
1 parent 46288f5 commit 44f02de2ad6d22d0d781c0c7303bcd8162aaa5d6 @ffmike ffmike committed with dhh Feb 1, 2009
View
2 railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb
@@ -2,7 +2,7 @@ class <%= controller_class_name %>Controller < ApplicationController
# GET /<%= table_name %>
# GET /<%= table_name %>.xml
def index
- @<%= table_name %> = <%= class_name %>.find(:all)
+ @<%= table_name %> = <%= class_name %>.all
respond_to do |format|
format.html # index.html.erb
View
2 railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb
@@ -7,7 +7,7 @@
<% end -%>
</tr>
-<%% for <%= singular_name %> in @<%= plural_name %> %>
+<%% @<%= plural_name %>.each do |<%= singular_name %>| %>
<tr>
<% for attribute in attributes -%>
<td><%%=h <%= singular_name %>.<%= attribute.name %> %></td>

0 comments on commit 44f02de

Please sign in to comment.