vendredi 6 mai 2016

Conditional Route on sign_out using Devise with Rails

I am working on an app in which there is a model User with roles member and Admin.

As per requirement, I have to made two separate login pages for Admin and Member.

with http://localhost:3000/admin/admin_login

it goes to admin login page and with

http://localhost:3000/users/sign_in

it goes to member login page. Just after login I route them according to their roles to Admin panel or simple website for members.

But at time of logout both goes to http://localhost:3000

but I want admin to go to http://localhost:3000/admin/admin_login, while http://localhost:3000 is fine for member's logout.

Is there a way to see User's Role at time of Sign_out and route them accordingly.

Aucun commentaire:

Enregistrer un commentaire