diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-05-12 16:04:06 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-05-12 16:04:06 -0700 |
commit | 7be33feb17cb3af52025e959d40efe02ddbdcc4c (patch) | |
tree | 5e3de7403cd8c9ceb24abe01efa5e59beb9789ae /actionpack/lib/action_view/helpers | |
parent | 99e2a223e8a5fd0943f2e2168fb2866eb831030c (diff) | |
parent | 5636010392b12273324846cf1d8baa46d0d857da (diff) | |
download | rails-7be33feb17cb3af52025e959d40efe02ddbdcc4c.tar.gz rails-7be33feb17cb3af52025e959d40efe02ddbdcc4c.tar.bz2 rails-7be33feb17cb3af52025e959d40efe02ddbdcc4c.zip |
Merge pull request #6171 from oscardelben/move_token_tag_if_block
Switch token_tag if block
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/url_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 1145f348c2..802bf9d29f 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -670,11 +670,11 @@ module ActionView end def token_tag(token=nil) - if token == false || !protect_against_forgery? - '' - else + if token != false && protect_against_forgery? token ||= form_authenticity_token tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => token) + else + '' end end |