Sha256: 5ebf8b379357a844aba6ca12f1a921c1f9a5671a55c7cf73730915f178a70993

Contents?: true

Size: 527 Bytes

Versions: 39

Compression:

Stored size: 527 Bytes

Contents

module ActionView
  # = Action View CSRF Helper
  module Helpers
    module CsrfHelper
      # Returns a meta tag with the cross-site request forgery protection token
      # for forms to use. Place this in your head.
      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
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
actionpack-3.0.20 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.19 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.18 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.17 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.16 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.15 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.14 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.13 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.13.rc1 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.12 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.12.rc1 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.11 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.10 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.10.rc1 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.9 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.9.rc5 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.9.rc4 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.9.rc3 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.9.rc1 lib/action_view/helpers/csrf_helper.rb
actionpack-3.0.8 lib/action_view/helpers/csrf_helper.rb