Changeset 3993
- Timestamp:
- 03/20/06 05:39:13 (3 years ago)
- Files:
-
- trunk/actionpack/lib/action_controller/scaffolding.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/templates/scaffolds/list.rhtml (modified) (1 diff)
- trunk/railties/html/500.html (modified) (1 diff)
- trunk/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb (modified) (1 diff)
- trunk/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/scaffolding.rb
r3864 r3993 100 100 module_eval <<-"end_eval", __FILE__, __LINE__ 101 101 102 verify :method =>:post, :only=>[:destroy#{suffix}, :create#{suffix}, :update#{suffix}],103 :redirect_to =>{:action=>:list#{suffix}}102 verify :method => :post, :only => [ :destroy#{suffix}, :create#{suffix}, :update#{suffix} ], 103 :redirect_to => { :action => :list#{suffix} } 104 104 105 105 trunk/actionpack/lib/action_controller/templates/scaffolds/list.rhtml
r3864 r3993 15 15 <td><%= link_to "Show", :action => "show#{@scaffold_suffix}", :id => entry %></td> 16 16 <td><%= link_to "Edit", :action => "edit#{@scaffold_suffix}", :id => entry %></td> 17 <td><%= link_to "Destroy", {:action => "destroy#{@scaffold_suffix}", :id => entry}, { :confirm => "Are you sure?", :post=>true} %></td>17 <td><%= link_to "Destroy", {:action => "destroy#{@scaffold_suffix}", :id => entry}, { :confirm => "Are you sure?", :post => true} %></td> 18 18 </tr> 19 19 <% end %> trunk/railties/html/500.html
r1605 r3993 3 3 <html> 4 4 <body> 5 <h1>Application error (Apache)</h1>5 <h1>Application error</h1> 6 6 <p>Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html</p> 7 7 </body> trunk/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb
r3864 r3993 12 12 13 13 <% end -%> 14 15 # GET should only be used for operations which are 'safe', or read-only. So require 16 # post for all actions which change state. 17 # 18 # http://www.w3.org/2001/tag/doc/whenToUseGet.html 19 verify :method=>:post, :only=>[:destroy<%= suffix %>, :create<%= suffix %>, :update<%= suffix %>], 20 :redirect_to=> {:action=>:list<%= suffix %>} 14 # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) 15 verify :method => :post, :only => [ :destroy<%= suffix %>, :create<%= suffix %>, :update<%= suffix %> ], 16 :redirect_to => { :action => :list<%= suffix %> } 21 17 22 18 def list<%= suffix %> trunk/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml
r3864 r3993 15 15 <td><%%= link_to 'Show', :action => 'show<%= suffix %>', :id => <%= singular_name %> %></td> 16 16 <td><%%= link_to 'Edit', :action => 'edit<%= suffix %>', :id => <%= singular_name %> %></td> 17 <td><%%= link_to 'Destroy', { :action => 'destroy<%= suffix %>', :id => <%= singular_name %> }, :confirm => 'Are you sure?', :post =>true %></td>17 <td><%%= link_to 'Destroy', { :action => 'destroy<%= suffix %>', :id => <%= singular_name %> }, :confirm => 'Are you sure?', :post => true %></td> 18 18 </tr> 19 19 <%% end %>