diff --git a/actionpack/lib/action_controller/scaffolding.rb b/actionpack/lib/action_controller/scaffolding.rb index 3b612df357..8b5554c266 100644 --- a/actionpack/lib/action_controller/scaffolding.rb +++ b/actionpack/lib/action_controller/scaffolding.rb @@ -99,8 +99,8 @@ module ActionController module_eval <<-"end_eval", __FILE__, __LINE__ - verify :method=>:post, :only=>[:destroy#{suffix}, :create#{suffix}, :update#{suffix}], - :redirect_to=>{:action=>:list#{suffix}} + verify :method => :post, :only => [ :destroy#{suffix}, :create#{suffix}, :update#{suffix} ], + :redirect_to => { :action => :list#{suffix} } def list#{suffix} diff --git a/actionpack/lib/action_controller/templates/scaffolds/list.rhtml b/actionpack/lib/action_controller/templates/scaffolds/list.rhtml index 37e761679c..fad2aab7e4 100644 --- a/actionpack/lib/action_controller/templates/scaffolds/list.rhtml +++ b/actionpack/lib/action_controller/templates/scaffolds/list.rhtml @@ -14,7 +14,7 @@ <% end %> <%= link_to "Show", :action => "show#{@scaffold_suffix}", :id => entry %> <%= link_to "Edit", :action => "edit#{@scaffold_suffix}", :id => entry %> - <%= link_to "Destroy", {:action => "destroy#{@scaffold_suffix}", :id => entry}, {:confirm => "Are you sure?", :post=>true} %> + <%= link_to "Destroy", {:action => "destroy#{@scaffold_suffix}", :id => entry}, { :confirm => "Are you sure?", :post => true} %> <% end %> diff --git a/railties/html/500.html b/railties/html/500.html index a1001a008d..ab95f74c46 100644 --- a/railties/html/500.html +++ b/railties/html/500.html @@ -2,7 +2,7 @@ "http://www.w3.org/TR/html4/loose.dtd"> -

Application error (Apache)

+

Application error

Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html

\ No newline at end of file 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 %> <%%= link_to 'Show', :action => 'show<%= suffix %>', :id => <%= singular_name %> %> <%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => <%= singular_name %> %> - <%%= link_to 'Destroy', { :action => 'destroy<%= suffix %>', :id => <%= singular_name %> }, :confirm => 'Are you sure?', :post=>true %> + <%%= link_to 'Destroy', { :action => 'destroy<%= suffix %>', :id => <%= singular_name %> }, :confirm => 'Are you sure?', :post => true %> <%% end %>