aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb')
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb10
1 files changed, 3 insertions, 7 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