aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/base.rb5
-rw-r--r--actionpack/lib/action_controller/railtie.rb9
-rw-r--r--actionpack/lib/action_controller/railties/paths.rb6
3 files changed, 11 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 1953e1869f..b37bc02127 100644
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -221,11 +221,6 @@ module ActionController
# Rails 2.x compatibility
include ActionController::Compatibility
- def self.inherited(klass)
- super
- klass.helper :all if klass.superclass == ActionController::Base
- end
-
ActiveSupport.run_load_hooks(:action_controller, self)
end
end
diff --git a/actionpack/lib/action_controller/railtie.rb b/actionpack/lib/action_controller/railtie.rb
index 2271a51e4e..0cb4041855 100644
--- a/actionpack/lib/action_controller/railtie.rb
+++ b/actionpack/lib/action_controller/railtie.rb
@@ -42,10 +42,19 @@ module ActionController
end
initializer "action_controller.set_configs" do |app|
+ 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
+
ActiveSupport.on_load(:action_controller) do
include app.routes.mounted_helpers(:app)
extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)
extend ::ActionController::Railties::Paths.with(app)
+ options.each { |k,v| send("#{k}=", v) }
end
end
diff --git a/actionpack/lib/action_controller/railties/paths.rb b/actionpack/lib/action_controller/railties/paths.rb
index 095beb7a2f..81d03f5e73 100644
--- a/actionpack/lib/action_controller/railties/paths.rb
+++ b/actionpack/lib/action_controller/railties/paths.rb
@@ -14,12 +14,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.helpers_path ||= paths.app.helpers.to_a
options.each { |k,v| klass.send("#{k}=", v) }
+
+ klass.helper :all
end
end
end