diff options
Diffstat (limited to 'railties/lib/rails_generator/generators/components/scaffold')
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb | 10 | ||||
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml | 2 |
2 files changed, 4 insertions, 8 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 9595fcca61..c059e74536 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb @@ -11,13 +11,9 @@ class <%= controller_class_name %>Controller < ApplicationController end <% end -%> - - # GET should only be used for operations which are 'safe', or read-only. So require - # post for all actions which change state. - # - # http://www.w3.org/2001/tag/doc/whenToUseGet.html - verify :method=>:post, :only=>[:destroy<%= suffix %>, :create<%= suffix %>, :update<%= suffix %>], - :redirect_to=> {:action=>:list<%= suffix %>} + # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) + verify :method => :post, :only => [ :destroy<%= suffix %>, :create<%= suffix %>, :update<%= suffix %> ], + :redirect_to => { :action => :list<%= suffix %> } def list<%= suffix %> @<%= singular_name %>_pages, @<%= plural_name %> = paginate :<%= plural_name %>, :per_page => 10 diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml b/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml index 2c6314f4bb..ea1ca7ea53 100644 --- a/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml +++ b/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml @@ -14,7 +14,7 @@ <%% end %> <td><%%= link_to 'Show', :action => 'show<%= suffix %>', :id => <%= singular_name %> %></td> <td><%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => <%= singular_name %> %></td> - <td><%%= link_to 'Destroy', { :action => 'destroy<%= suffix %>', :id => <%= singular_name %> }, :confirm => 'Are you sure?', :post=>true %></td> + <td><%%= link_to 'Destroy', { :action => 'destroy<%= suffix %>', :id => <%= singular_name %> }, :confirm => 'Are you sure?', :post => true %></td> </tr> <%% end %> </table> |