Module: ActionView::Helpers::CsrfHelper
- Included in:
- ActionView::Helpers
- Defined in:
- actionpack/lib/action_view/helpers/csrf_helper.rb
Instance Method Summary (collapse)
-
- (Object) csrf_meta_tag
Returns a meta tag with the cross-site request forgery protection token for forms to use.
Instance Method Details
- (Object) csrf_meta_tag
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 'actionpack/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 |