diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-19 05:54:35 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-19 05:54:35 -0800 |
commit | 5caf1bd2148825404166254f676a7d4e4615cdc7 (patch) | |
tree | 2cf761a8776fa1cd726033c6a0f2cac0122e5c87 /actionpack/lib/action_view/helpers/form_tag_helper.rb | |
parent | b5134601adebd1dbebc18be35c5e5336011a023f (diff) | |
parent | 71597f9d51887885c826a05d14680e26c86e622f (diff) | |
download | rails-5caf1bd2148825404166254f676a7d4e4615cdc7.tar.gz rails-5caf1bd2148825404166254f676a7d4e4615cdc7.tar.bz2 rails-5caf1bd2148825404166254f676a7d4e4615cdc7.zip |
Merge pull request #4532 from rafaelfranca/av-button_to-refactor
Refactor button_to helper to use token_tag method
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_tag_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_tag_helper.rb | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 57b90a9c42..e97f602728 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -627,7 +627,7 @@ module ActionView token_tag(authenticity_token) else html_options["method"] = "post" - tag(:input, :type => "hidden", :name => "_method", :value => method) + token_tag(authenticity_token) + method_tag(method) + token_tag(authenticity_token) end tags = utf8_enforcer_tag << method_tag @@ -646,15 +646,6 @@ module ActionView output.safe_concat("</form>") end - def token_tag(token) - if token == false || !protect_against_forgery? - '' - else - token ||= form_authenticity_token - tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => token) - end - end - # see http://www.w3.org/TR/html4/types.html#type-name def sanitize_to_id(name) name.to_s.gsub(']','').gsub(/[^-a-zA-Z0-9:.]/, "_") |