Hoping you can help,
I’ve been using a lot of cancan, and in particular the load and authorize functionality. Unfortunately I feel that this has a side effect when dealing with nested routes in particular, of either hiding away implicit conditionals in the controller action, or forcing conditionals through case statements when you want to return something different than just
@resource.posts for example.
After reading Rails anti-patterns, and dealing with this for a while, I feel like I should perhaps be reaching for a new controller when I declare a new nested route with the same resource particularly if its a choice between a conditional, or just a small controller with one action. However someone has suggested I should just use a case statement instead, which I feel is not the right choice.
What are people’s opinions here? How have you approached this problem?