I am trying to create a web application using ruby on rails. In this application a user has multiple roles like
But the thing is a user can switch between these roles by changing account settings in the application.
eg : Student can also change his role as teacher and then they can teach someothers
When they change the role the pages, timeline, homepage everything should be display according to their current role.
How can i model the database for this and how can i perform the associations for this ?
I am new to ruby on rails so please help & thanks in advance!
Ofcourse! you can keep track of current user and then you assign user role when they switch.
If not you can also use rolify gem to add or remove roles and [cancan][3]
gem for authorization.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments