diff options
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb b/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb index cbfd88f3bd..4d190b9362 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb +++ b/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 diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb b/railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb index e89757e3e9..f51fe85dc9 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb +++ b/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> |