aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2010-11-18 00:06:03 +0100
committerJosé Valim <jose.valim@gmail.com>2010-11-18 00:20:57 +0100
commit250fb3f6c297e1f0bdc80a44ae6ac77c04cd9c85 (patch)
tree26501df142c4c458f64cec56d993f63c5863f997 /actionpack/lib/action_controller
parent4d35f8b6615d31fbed4806ee3c260e24447f435b (diff)
downloadrails-250fb3f6c297e1f0bdc80a44ae6ac77c04cd9c85.tar.gz
rails-250fb3f6c297e1f0bdc80a44ae6ac77c04cd9c85.tar.bz2
rails-250fb3f6c297e1f0bdc80a44ae6ac77c04cd9c85.zip
Add config.action_controller.include_all_helpers, by default it is set to true.
In older rails versions there was a way to use only helpers from helper file corresponding to current controller and you could also include all helpers by saying 'helper :all' in controller. This config allows to return to older behavior by setting it to false.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/metal/helpers.rb3
-rw-r--r--actionpack/lib/action_controller/railties/paths.rb4
2 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/helpers.rb b/actionpack/lib/action_controller/metal/helpers.rb
index d14831b763..91a88ab68a 100644
--- a/actionpack/lib/action_controller/metal/helpers.rb
+++ b/actionpack/lib/action_controller/metal/helpers.rb
@@ -53,8 +53,9 @@ module ActionController
include AbstractController::Helpers
included do
- config_accessor :helpers_path
+ config_accessor :helpers_path, :include_all_helpers
self.helpers_path ||= []
+ self.include_all_helpers = true
end
module ClassMethods
diff --git a/actionpack/lib/action_controller/railties/paths.rb b/actionpack/lib/action_controller/railties/paths.rb
index 7a59d4f2f3..699c44c62c 100644
--- a/actionpack/lib/action_controller/railties/paths.rb
+++ b/actionpack/lib/action_controller/railties/paths.rb
@@ -13,7 +13,9 @@ module ActionController
end
klass.helpers_path = paths
- klass.helper :all if klass.superclass == ActionController::Base
+ if klass.superclass == ActionController::Base && ActionController::Base.include_all_helpers
+ klass.helper :all
+ end
end
end
end