aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-06-14 13:23:55 +0000
committerJamis Buck <jamis@37signals.com>2005-06-14 13:23:55 +0000
commit75fb0a32a817317ea6ccccfb3ee6b7cd99824ce9 (patch)
tree2f696783e8a8094d6f6e4d226d5f567c46cf58ed /actionpack/lib
parentb2b757be393fa33da8916249c9d77b2bce56bcaf (diff)
downloadrails-75fb0a32a817317ea6ccccfb3ee6b7cd99824ce9.tar.gz
rails-75fb0a32a817317ea6ccccfb3ee6b7cd99824ce9.tar.bz2
rails-75fb0a32a817317ea6ccccfb3ee6b7cd99824ce9.zip
Support :render option to :verify #1440 [TobiasLuetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1418 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/verification.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/verification.rb b/actionpack/lib/action_controller/verification.rb
index 291da0b99a..ec3c5fe26c 100644
--- a/actionpack/lib/action_controller/verification.rb
+++ b/actionpack/lib/action_controller/verification.rb
@@ -52,6 +52,8 @@ module ActionController #:nodoc:
# into the session's flash if the prerequisites cannot be satisfied.
# * <tt>:redirect_to</tt>: the redirection parameters to be used when
# redirecting if the prerequisites cannot be satisfied.
+ # * <tt>:render</tt>: the render parameters to be used when
+ # the prerequisites cannot be satisfied.
# * <tt>:only</tt>: only apply this verification to the actions specified
# in the associated array (may also be a single value).
# * <tt>:except</tt>: do not apply this verification to the actions
@@ -77,7 +79,10 @@ module ActionController #:nodoc:
if prereqs_invalid
flash.update(options[:add_flash]) if options[:add_flash]
- redirect_to(options[:redirect_to]) if options[:redirect_to] unless performed?
+ unless performed?
+ render(options[:render]) if options[:render]
+ redirect_to(options[:redirect_to]) if options[:redirect_to]
+ end
return false
end