Rails 和设计 Gem:避免某些控制器和操作的存储会话
Rails and Devise Gem: Avoiding store session for certain controller and action
对于某些 ajax 呼叫,我想跳过存储会话。我使用设计 gem,何时以及如何指定要排除更新会话的操作?
问候
在控制器中添加:
after_action -> { request.session_options[:skip] = true }
根据评论here:
:skip will not a set a cookie in the response nor update the session state
对于某些 ajax 呼叫,我想跳过存储会话。我使用设计 gem,何时以及如何指定要排除更新会话的操作?
问候
在控制器中添加:
after_action -> { request.session_options[:skip] = true }
根据评论here:
:skip will not a set a cookie in the response nor update the session state