1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Switch token_tag if block

This commit is contained in:
Oscar Del Ben 2012-05-05 14:12:08 +02:00
parent acb39848ae
commit 5636010392

View file

@ -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