instance method storage_strategy

Ruby on Rails 7.2.3

Since v7.1.6 Private

Available in: v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

storage_strategy(name)

No documentation comment.

Parameters

name req
Source
# File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 236
        def storage_strategy(name)
          case name
          when :session
            SessionStore.new
          when :cookie
            CookieStore.new(:csrf_token)
          else
            return name if is_storage_strategy?(name)
            raise ArgumentError, "Invalid CSRF token storage strategy, use :session, :cookie, or a custom CSRF token storage class."
          end
        end

Defined in actionpack/lib/action_controller/metal/request_forgery_protection.rb line 236 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::RequestForgeryProtection::ClassMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close