Methods

Class/Module Index [+]

Quicksearch

ActionView::Helpers::CsrfHelper

Public Instance Methods

csrf_meta_tag() click to toggle source

Returns a meta tag with the cross-site request forgery protection token for forms to use. Place this in your head.

# File D:/Develope/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_view/helpers/csrf_helper.rb, line 7
def csrf_meta_tag
  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

[Validate]

Generated with the Darkfish Rdoc Generator 2.