Created
February 26, 2011 18:36
-
-
Save danielmorrison/845475 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def csrf_meta_tags | |
if protect_against_forgery? | |
[].tap do |tags| | |
tags << tag('meta', {:name => 'csrf-param', :content => request_forgery_protection_token}) | |
tags << tag('meta', {:name => 'csrf-token', :content => form_authenticity_token}) | |
end.join("\n").html_safe | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment