Rails controllers and OOP
I have written a much better explanation, please read that instead: Explaining Focused Controller
Rails controllers violate the Single Responsibility Principle. Each “action” has a different responsibility and should be contained in a separate object. Controllers are also hard to unit test, so we end up using slow “functional tests”.
I wrote a plugin named Focused Controller a while back, as part of this experiment, but have kept quiet about it until now, partly because it was undocumented.
But now I’m ready to announce it and I’m really keen for people to try it out and share their thoughts about this idea. I’ve gone into detail about the problems and solutions in the README, so I won’t repeat that here. Please just check it out!