制定独立的标志出两种不同的模式 [英] Devise separate sign out for two different models
问题描述
我有两个机型的用户和管理员(使用RailsAdmin)使用设计。本人签收以用户身份,然后登录作为管理员。但是从车型之一注销的结果,同时注销两款车型。我该如何解决?
请帮助:)
I have two models User and Admin(with RailsAdmin) that use Devise. I sign in as user and then sign in as admin. But the result of signing out from one of that models is signing out of two models at the same time. How can I fix it? Please, help :)
推荐答案
这个问题是在一个字符串中的配置/初始化/ devise.rb:
The problem was in one string in config/initializers/devise.rb:
-
默认值:
Default:
#配置SIGN_OUT行为。结果
#SIGN_OUT动作可以作用域(即/用户/ SIGN_OUT只影响:用户范围)结果。
#默认值是true,这意味着任何注销动作将注销所有活动范围。结果
#config.sign_out_all_scopes =的真正的
# Configure sign_out behavior.
# Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
# The default is true, which means any logout action will sign out all active scopes.
# config.sign_out_all_scopes = true
需要:
config.sign_out_all_scopes =的假的
config.sign_out_all_scopes = false
这篇关于制定独立的标志出两种不同的模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!