0

I am working on a rails application and using 'devise'for authentication , I have different models ( admin - user ) and I need only one login page

In my case making an admin role or using single table inheritance (STI) is not effective as user and admin don't have much in common so is there a better solution for my problem

Youssef Emad
  • 319
  • 2
  • 13

1 Answers1

0

You could have a radio button select for choosing the roles and create customised controller for devise. Here is an answer for helping you in creating customising controller. Now in the controller action you could insert into the model depending upon the radio button value. Although I had a different approach while I had once faced this issue. I had created two Sign-in forms in a single page and used jquery flipster to slide through the forms. Here is an example of a flipster looks like. Let me know if you need further clarifications. Hope it helps.

Community
  • 1
  • 1
Saurabh
  • 1,086
  • 1
  • 15
  • 27