1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Move controller configs to sprockets own railtie.

This commit is contained in:
José Valim 2011-04-17 10:26:32 +02:00
parent eb75f15a1a
commit 16b9547a88
2 changed files with 10 additions and 1 deletions

View file

@ -4,6 +4,7 @@ require "action_dispatch/railtie"
require "action_view/railtie" require "action_view/railtie"
require "abstract_controller/railties/routes_helpers" require "abstract_controller/railties/routes_helpers"
require "action_controller/railties/paths" require "action_controller/railties/paths"
require "sprockets/railtie"
module ActionController module ActionController
class Railtie < Rails::Railtie class Railtie < Rails::Railtie
@ -21,7 +22,6 @@ module ActionController
paths = app.config.paths paths = app.config.paths
options = app.config.action_controller options = app.config.action_controller
options.use_sprockets ||= app.config.assets.enabled
options.assets_dir ||= paths["public"].first options.assets_dir ||= paths["public"].first
options.javascripts_dir ||= paths["public/javascripts"].first options.javascripts_dir ||= paths["public/javascripts"].first
options.stylesheets_dir ||= paths["public/stylesheets"].first options.stylesheets_dir ||= paths["public/stylesheets"].first

View file

@ -0,0 +1,9 @@
require "sprockets"
class Sprockets::Railtie < Rails::Railtie
initializer "sprockets.set_configs", :after => "action_controller.set_configs" do |app|
ActiveSupport.on_load(:action_controller) do
self.use_sprockets = app.config.assets.enabled
end
end
end