From a28817948dd41bdf921a0976d711e955d959dda2 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Wed, 21 Jun 2006 02:19:40 +0000 Subject: documentation fixes for ActionController::Verification::ClassMethods verify method. Closes #4310. [oleg.frolov@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4479 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/verification.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/actionpack/lib/action_controller/verification.rb b/actionpack/lib/action_controller/verification.rb index cd6f777486..8e0b255f26 100644 --- a/actionpack/lib/action_controller/verification.rb +++ b/actionpack/lib/action_controller/verification.rb @@ -17,14 +17,18 @@ module ActionController #:nodoc: # Usage: # # class GlobalController < ActionController::Base - # # prevent the #update_settings action from being invoked unless - # # the 'admin_privileges' request parameter exists. + # # Prevent the #update_settings action from being invoked unless + # # the 'admin_privileges' request parameter exists. The + # # settings action will be redirected to in current controller + # # if verification fails. # verify :params => "admin_privileges", :only => :update_post, # :redirect_to => { :action => "settings" } # - # # disallow a post from being updated if there was no information + # # Disallow a post from being updated if there was no information # # submitted with the post, and if there is no active post in the - # # session, and if there is no "note" key in the flash. + # # session, and if there is no "note" key in the flash. The route + # # named category_url will be redirected to if verification fails. + # # verify :params => "post", :session => "post", "flash" => "note", # :only => :update_post, # :add_flash => { "alert" => "Failed to create your message" }, @@ -54,7 +58,8 @@ module ActionController #:nodoc: # merged into the response's headers hash if the prerequisites cannot # be satisfied. # * :redirect_to: the redirection parameters to be used when - # redirecting if the prerequisites cannot be satisfied. + # redirecting if the prerequisites cannot be satisfied. You can + # redirect either to named route or to the action in some controller. # * :render: the render parameters to be used when # the prerequisites cannot be satisfied. # * :only: only apply this verification to the actions specified -- cgit v1.2.3