I just spent a good deal of time trying to debug a controller action that was erroneously marked protected. When I commented out the action and Rails didn’t respond with Unknown action as I’d expected, I became suspicious.
Turns out that having an appropriately named view is enough for Rails to define a controller action. So my two questions are:
- Why on Earth does Rails do that? To help newbies?
- Can I keep Rails from doing this with some piece of config?
This might not answer all your question, but the Rails Guide on rendering discusses this in the section
Rendering by Default: Convention Over Configuration in Action