Topic: DRY site for multiple user types/roles
I wanted to solicit feedback on what the best way to go about organizing a site which will have multiple user types, each with a very different view of the application. There are some conflicting goals when doing this, namely:
- There are 3 different user types
- Want to remain RESTful (only 7 actions)
- Don't want to put too much logic in the views
- Want to show users different things when they visit some Actions (some are the same, some very different)
- Keep the application flexible
So, if each user type should see something different when they visit a URL, should I
1. put logic in the controller which renders a different template depending on the user type. (so maybe have role1_show.html.erb, role2_show.html.erb, etc)
2. put logic in the view to render different things depending on the user type (this isn't as bad as it may seem since 80-90% on average is re-use). This is hard because I don't want to have too much logic in the controllers and the views for one user type can break when I change something in the controller for a different user type.
3. implement different controllers for each user type (I've never heard of someone doing this, but I just it might be a possible solution)
4. Something amazing I haven't thought of...
Thanks for your suggestions.