So I’m looking for best practices, advice, feedback, etc. on this.
How do you handle multiple views for the same action? How do you
decide when one way is better than another?
If I have a view for an end-user and the same view for an admin, but
some things are supposed to be different, how do you manage that well?
I know the basic functional ways, I’m just wondering about
recommendations to keep it clean and as DRY as possible.
For example, if the difference is minimal, maybe wrap some code in the
view itself. I.e. if showing a Foo and the admin should have an “edit
foo” link but otherwise the display is the same, then I’d probably
just wrap a role check or something in an if statement in the view.
But what about when it gets a little more complex… different
content_for blocks… different layout… even some different main
If they are radically different (the other extreme), I’d make two
separate views and switch in the controller.