aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/verification.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/verification.rb')
-rw-r--r--actionpack/lib/action_controller/verification.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/verification.rb b/actionpack/lib/action_controller/verification.rb
index ec3c5fe26c..78918f800c 100644
--- a/actionpack/lib/action_controller/verification.rb
+++ b/actionpack/lib/action_controller/verification.rb
@@ -76,7 +76,9 @@ module ActionController #:nodoc:
prereqs_invalid ||=
[*options[:method]].all? { |v| @request.method != v.to_sym }
end
-
+
+ prereqs_invalid ||= (request.xhr? != options[:xhr]) unless options[:xhr].nil?
+
if prereqs_invalid
flash.update(options[:add_flash]) if options[:add_flash]
unless performed?