mercredi 2 novembre 2016

How to create multiple roles for single user in ruby on rails?

I am trying to create a web application using ruby on rails. In this application a user has multiple roles like

  1. role1 = teacher
  2. role2 = student
  3. role3 = staff

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!

Aucun commentaire:

Enregistrer un commentaire