instance method
storage_strategy
Ruby on Rails 8.0.4
Since v7.1.6 PrivateSignature
storage_strategy(name)
No documentation comment.
Parameters
-
namereq
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