Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 3993

Show
Ignore:
Timestamp:
03/20/06 05:39:13 (3 years ago)
Author:
david
Message:

My beautiful eyes [DHH]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/scaffolding.rb

    r3864 r3993  
    100100        module_eval <<-"end_eval", __FILE__, __LINE__ 
    101101           
    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}
    104104           
    105105         
  • trunk/actionpack/lib/action_controller/templates/scaffolds/list.rhtml

    r3864 r3993  
    1515    <td><%= link_to "Show", :action => "show#{@scaffold_suffix}", :id => entry %></td> 
    1616    <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> 
    1818  </tr> 
    1919<% end %> 
  • trunk/railties/html/500.html

    r1605 r3993  
    33<html> 
    44<body> 
    5   <h1>Application error (Apache)</h1> 
     5  <h1>Application error</h1> 
    66  <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> 
    77</body> 
  • trunk/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb

    r3864 r3993  
    1212 
    1313<% 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 %> } 
    2117 
    2218  def list<%= suffix %> 
  • trunk/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml

    r3864 r3993  
    1515    <td><%%= link_to 'Show', :action => 'show<%= suffix %>', :id => <%= singular_name %> %></td> 
    1616    <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> 
    1818  </tr> 
    1919<%% end %>