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:
parent
acb39848ae
commit
5636010392
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue