I am trying to create a web application using ruby on rails. In this application, the user has several roles, such as
- role1 = teacher
- role2 = student
- role3 = staff
But the user can switch between these roles by changing the account settings in the application.
for example:
A student can also change his role as a teacher, and then they can teach others
When they change the role of pages, the timeline, the main page, everything should be displayed in accordance with their current role.
How can I model a database for this and how can I perform associations for this?
I am new to rubies on rails, so please help and thanks in advance!
source
share