Module: ActionView::Helpers::CsrfHelper
- Included in:
- ActionView::Helpers
- Defined in:
- lib/action_view/helpers/csrf_helper.rb
Instance Method Summary collapse
-
#csrf_meta_tag ⇒ Object
Returns a meta tag with the cross-site request forgery protection token for forms to use.
Instance Method Details
#csrf_meta_tag ⇒ Object
Returns a meta tag with the cross-site request forgery protection token for forms to use. Place this in your head.
7 8 9 10 11 |
# File 'lib/action_view/helpers/csrf_helper.rb', line 7 def if protect_against_forgery? %(<meta name="csrf-param" content="#{Rack::Utils.escape_html(request_forgery_protection_token)}"/>\n<meta name="csrf-token" content="#{Rack::Utils.escape_html(form_authenticity_token)}"/>).html_safe end end |