I have a case when I need localhost:3000/dashboard to point to different view/controller combinations based on the type of the user. Two main types in my application are Subscriber and Publisher.
When Publisher logs in and goes to /dashboard I need to show the Publisher Dashboard.
When Subscriber logs in and goes to /dashboard I need to show the Subscriber Dashboard.
At this moment Publisher’s dashboard is called Dashboard and subscriber’s dashboard is called Profile. Seems to me a little dirty.
The question is. What is the best way to call the right controller, load the right data and render the right template/layout based on a type of a particular user?
I would consider something like the following pseudo code to get you started.
Controller:
View:
(Use the helper to change what will be displayed).
Helper.