Answer the question
In order to leave comments, you need to log in
Rails: how to correctly separate views (view) of different user roles?
Hello
There are 4 user roles in the system (devise+cancan). Now the check for the role occurs in the entity controllers and in the views, but this was a temporary and definitely not the right decision. At the moment, you need to enter another user role. So I decided to redo the process. So far, I think the solution is checking for a role in application_contoller and redirecting to a specific namescape. Could you tell me if this option is not quite right for this situation and is there a better solution?
Answer the question
In order to leave comments, you need to log in
We used https://github.com/inossidabile/protector and danced in the views from the visibility of attributes, which gives sufficient convenience, since without changing the views you can change the logic of the roles and introduce new ones
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question