aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-10-06 17:18:59 +0200
committerJosé Valim <jose.valim@gmail.com>2010-10-06 17:20:15 +0200
commitd649bf158be130515566aed987f83d36ac9b0ae8 (patch)
tree4d056bbc2d84903dbf6931e0ee6aa6ded01094cd /actionpack/lib/action_controller
parentd40ca9cce241a8083756c993d6c99a79e62e050e (diff)
downloadrails-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')
-rw-r--r--actionpack/lib/action_controller/railtie.rb8
-rw-r--r--actionpack/lib/action_controller/railties/paths.rb6
2 files changed, 8 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/railtie.rb b/actionpack/lib/action_controller/railtie.rb
index 0ade42ba2d..c5a661f2b0 100644
--- a/actionpack/lib/action_controller/railtie.rb
+++ b/actionpack/lib/action_controller/railtie.rb
@@ -21,10 +21,10 @@ module ActionController
paths = app.config.paths
options = app.config.action_controller
- options.assets_dir ||= paths.public.to_a.first
- options.javascripts_dir ||= paths.public.javascripts.to_a.first
- options.stylesheets_dir ||= paths.public.stylesheets.to_a.first
- options.page_cache_directory ||= paths.public.to_a.first
+ options.assets_dir ||= paths["public"].first
+ options.javascripts_dir ||= paths["public/javascripts"].first
+ options.stylesheets_dir ||= paths["public/stylesheets"].first
+ options.page_cache_directory ||= paths["public"].first
# make sure readers methods get compiled
options.asset_path ||= nil
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