Ensure that not all helpers are loaded for subclasses of ActionController::Base.


I came across this issue while upgrading my app to Rails 3. ActionController::Base is defining an inherited block that tells all ancestors to use `helper :all`. This is not the right default behaviour for controllers. In most views you'll simply want to have the designated helper available and the application helper.

By calling `helper :all`, all modules from app/helpers are sorted alphabetically and then included in the view. This has the side effect that the designated helper for this controller (ie. ProductsHelper for ProductsController) may not be the first helper in the scope of your view. This becomes a problem because the app I'm upgrading has conventions whereby a lot of helpers define a #title helper, for instance, that behaves differently in different views. By calling `helper :all` in my controller there is a good chance that the helper call will be sent to the wrong module, giving me the wrong result.

Here is how to reproduce the issue on the gem version of 3.0.0.rc: http://gist.github.com/517669

I've opened a ticket on lighthouse (and included a patch). Technically the patch doesn't include a new test, but I added a method to one of the existing helper modules defined in the fixtures. Without my change one of the existing tests will fail because it will call the wrong helper method.

Ticket is #5348 Visibility of helpers seems all wrong - Ruby on Rails - rails