我有三个设计模型Student
,,,Employer
。Admin
我希望不能同时以学生、管理员和雇主身份登录。
最好的方法是如何做到这一点?
我的路线
devise_for :admins, only: :sessions
devise_for :employers,
controllers: {
sessions: 'devise/employers_sessions'
}
authenticated :employer do
match 'dashboard' => 'employers#dashboard'
end
devise_for :students,
controllers: {
registrations: 'devise/students_registrations',
sessions: 'devise/students_sessions'
}