aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/url_helper.rb
diff options
context:
space:
mode:
authorOscar Del Ben <info@oscardelben.com>2012-05-05 14:12:08 +0200
committerOscar Del Ben <info@oscardelben.com>2012-05-05 14:12:08 +0200
commit5636010392b12273324846cf1d8baa46d0d857da (patch)
tree62295c694c832de906816348037326d855268d3c /actionpack/lib/action_view/helpers/url_helper.rb
parentacb39848ae4cfe1d22cd8a83c5db636d80c22b47 (diff)
downloadrails-5636010392b12273324846cf1d8baa46d0d857da.tar.gz
rails-5636010392b12273324846cf1d8baa46d0d857da.tar.bz2
rails-5636010392b12273324846cf1d8baa46d0d857da.zip
Switch token_tag if block
Diffstat (limited to 'actionpack/lib/action_view/helpers/url_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb6
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