aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-09-23 18:14:44 +0000
committerRick Olson <technoweenie@gmail.com>2007-09-23 18:14:44 +0000
commitc61900385452e50bd825f1ab5abef95bc969fadc (patch)
treed4fb78ed415dbb9dd69c0468eef0d039bf2817bc /actionpack/lib/action_view/helpers
parentda0725aae3c08543dcc39446236a5a1fc55a9136 (diff)
downloadrails-c61900385452e50bd825f1ab5abef95bc969fadc.tar.gz
rails-c61900385452e50bd825f1ab5abef95bc969fadc.tar.bz2
rails-c61900385452e50bd825f1ab5abef95bc969fadc.zip
Rename some RequestForgeryProtection methods. The class method is now #protect_from_forgery, and the default parameter is now 'authenticity_token'. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/form_tag_helper.rb2
-rw-r--r--actionpack/lib/action_view/helpers/prototype_helper.rb2
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb
index cb16131cc4..db74df26bf 100644
--- a/actionpack/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -424,7 +424,7 @@ module ActionView
if request_forgery_protection_token.nil?
''
else
- tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => form_token)
+ tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => form_authenticity_token)
end
end
end
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb
index df28a0395b..c6669ccde3 100644
--- a/actionpack/lib/action_view/helpers/prototype_helper.rb
+++ b/actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -745,7 +745,7 @@ module ActionView
else
js_options['parameters'] = "'"
end
- js_options['parameters'] << "_token=' + encodeURIComponent('#{escape_javascript form_token}')"
+ js_options['parameters'] << "#{request_forgery_protection_token}=' + encodeURIComponent('#{escape_javascript form_authenticity_token}')"
end
options_for_javascript(js_options)
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index 02c5c40727..96e4fdda48 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -474,7 +474,7 @@ module ActionView
if request_forgery_protection_token
submit_function << "var s = document.createElement('input'); s.setAttribute('type', 'hidden'); "
- submit_function << "s.setAttribute('name', '_token'); s.setAttribute('value', '#{escape_javascript form_token}'); f.appendChild(s);"
+ submit_function << "s.setAttribute('name', '#{request_forgery_protection_token}'); s.setAttribute('value', '#{escape_javascript form_authenticity_token}'); f.appendChild(s);"
end
submit_function << "f.submit();"
end