aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorSam Stephenson <sam@37signals.com>2006-04-08 07:04:21 +0000
committerSam Stephenson <sam@37signals.com>2006-04-08 07:04:21 +0000
commit23585d721d5da714c94b82905d38c7b77a67402a (patch)
treeb0ec6d7bf3bec4771271f575acb549ded0a9b132 /actionpack/lib
parent47b74e6e160b6fcbd47caeed6c98ae995e180a80 (diff)
downloadrails-23585d721d5da714c94b82905d38c7b77a67402a.tar.gz
rails-23585d721d5da714c94b82905d38c7b77a67402a.tar.bz2
rails-23585d721d5da714c94b82905d38c7b77a67402a.zip
Added :add_headers option to verify which merges a hash of name/value pairs into the response's headers hash if the prerequisites cannot be satisfied
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4201 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/verification.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/verification.rb b/actionpack/lib/action_controller/verification.rb
index 0bef8d85a8..cba4a2b739 100644
--- a/actionpack/lib/action_controller/verification.rb
+++ b/actionpack/lib/action_controller/verification.rb
@@ -51,6 +51,9 @@ module ActionController #:nodoc:
# from an Ajax call or not.
# * <tt>:add_flash</tt>: a hash of name/value pairs that should be merged
# into the session's flash if the prerequisites cannot be satisfied.
+ # * <tt>:add_headers</tt>: a hash of name/value pairs that should be
+ # merged into the response's headers hash 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
@@ -82,6 +85,7 @@ module ActionController #:nodoc:
if prereqs_invalid
flash.update(options[:add_flash]) if options[:add_flash]
+ response.headers.update(options[:add_headers]) if options[:add_headers]
unless performed?
render(options[:render]) if options[:render]
redirect_to(options[:redirect_to]) if options[:redirect_to]