diff options
author | José Valim <jose.valim@gmail.com> | 2010-10-06 17:18:59 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-10-06 17:20:15 +0200 |
commit | d649bf158be130515566aed987f83d36ac9b0ae8 (patch) | |
tree | 4d056bbc2d84903dbf6931e0ee6aa6ded01094cd /actionpack/lib/action_controller/railties | |
parent | d40ca9cce241a8083756c993d6c99a79e62e050e (diff) | |
download | rails-d649bf158be130515566aed987f83d36ac9b0ae8.tar.gz rails-d649bf158be130515566aed987f83d36ac9b0ae8.tar.bz2 rails-d649bf158be130515566aed987f83d36ac9b0ae8.zip |
Provide a cleaner syntax for paths configuration that does not rely on method_missing.
Diffstat (limited to 'actionpack/lib/action_controller/railties')
-rw-r--r-- | actionpack/lib/action_controller/railties/paths.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/railties/paths.rb b/actionpack/lib/action_controller/railties/paths.rb index fa71d55946..7a59d4f2f3 100644 --- a/actionpack/lib/action_controller/railties/paths.rb +++ b/actionpack/lib/action_controller/railties/paths.rb @@ -5,12 +5,14 @@ module ActionController Module.new do define_method(:inherited) do |klass| super(klass) + if namespace = klass.parents.detect {|m| m.respond_to?(:_railtie) } - klass.helpers_path = namespace._railtie.config.paths.app.helpers.to_a + paths = namespace._railtie.paths["app/helpers"].existent else - klass.helpers_path = app.config.helpers_paths + paths = app.config.helpers_paths end + klass.helpers_path = paths klass.helper :all if klass.superclass == ActionController::Base end end |