diff options
author | José Valim <jose.valim@gmail.com> | 2012-03-15 08:48:38 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-03-15 08:48:38 +0100 |
commit | fbc9d0f44f090a9873834f4966760c3e80682559 (patch) | |
tree | 70a3a93f8af3653b0ed8557b9c385fc3f105bf18 /actionpack/lib/action_controller/railties/helpers.rb | |
parent | 5b94e73d1a604c59ecd1ebb9441d60ea864fa1b5 (diff) | |
download | rails-fbc9d0f44f090a9873834f4966760c3e80682559.tar.gz rails-fbc9d0f44f090a9873834f4966760c3e80682559.tar.bz2 rails-fbc9d0f44f090a9873834f4966760c3e80682559.zip |
Simplify helpers handling. Ensure Metal can run AC hooks.
Diffstat (limited to 'actionpack/lib/action_controller/railties/helpers.rb')
-rw-r--r-- | actionpack/lib/action_controller/railties/helpers.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/railties/helpers.rb b/actionpack/lib/action_controller/railties/helpers.rb new file mode 100644 index 0000000000..3985c6b273 --- /dev/null +++ b/actionpack/lib/action_controller/railties/helpers.rb @@ -0,0 +1,22 @@ +module ActionController + module Railties + module Helpers + def inherited(klass) + super + return unless klass.respond_to?(:helpers_path=) + + if namespace = klass.parents.detect { |m| m.respond_to?(:railtie_helpers_paths) } + paths = namespace.railtie_helpers_paths + else + paths = ActionController::Helpers.helpers_path + end + + klass.helpers_path = paths + + if klass.superclass == ActionController::Base && ActionController::Base.include_all_helpers + klass.helper :all + end + end + end + end +end |