ruby on rails - Devise with multiple models -


how setup devise more 1 model? i've tried using rolify , cancan setup separate roles in database, each role has different way authenticate login. example, student have student_number, , lecturer have username no student_number. there bunch of other attributes lecturer won't have student , vice versa.

i'm new rails 4.

it looks classes , inheritance can come handy in case. defining user mode , let student , lecturer inherit class?

class student < user   # student's peculiar attributes end  class lecturer < user   # lecturer's peculiar attributes end 

then can have 2 separate controllers , corresponding views. the login page might have 2 links proper login pages.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -