aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-01-08 21:17:08 +0000
committerMichael Koziarski <michael@koziarski.com>2008-01-08 21:17:08 +0000
commit5ef8a81b846120b51b35503f5c2079036b321630 (patch)
tree8b056808c91117c3c8d3b095d947d9aa14861428 /actionpack/lib/action_view
parent934706a8da461a73fe429b3fcaa0e2ab055a9195 (diff)
downloadrails-5ef8a81b846120b51b35503f5c2079036b321630.tar.gz
rails-5ef8a81b846120b51b35503f5c2079036b321630.tar.bz2
rails-5ef8a81b846120b51b35503f5c2079036b321630.zip
Don't append the forgery token to an ajax request if it's serializing a form, prevents duplicate tokens. Closes #10684 [macournoyer]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8598 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/prototype_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb
index d9c980cd0d..6f5acac137 100644
--- a/actionpack/lib/action_view/helpers/prototype_helper.rb
+++ b/actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -1019,7 +1019,7 @@ module ActionView
js_options['parameters'] = options[:with]
end
- if protect_against_forgery?
+ if protect_against_forgery? && !options[:form]
if js_options['parameters']
js_options['parameters'] << " + '&"
else
@@ -1204,7 +1204,7 @@ module ActionView
append_enumerable_function!("zip(#{arguments_for_call arguments}")
if block
function_chain[-1] += ", function(array) {"
- yield ::ActiveSupport::JSON::Variable.new('array')
+ yield ActiveSupport::JSON::Variable.new('array')
add_return_statement!
@generator << '});'
else