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:
parent
eb75f15a1a
commit
16b9547a88
2 changed files with 10 additions and 1 deletions
|
@ -4,6 +4,7 @@ require "action_dispatch/railtie"
|
|||
require "action_view/railtie"
|
||||
require "abstract_controller/railties/routes_helpers"
|
||||
require "action_controller/railties/paths"
|
||||
require "sprockets/railtie"
|
||||
|
||||
module ActionController
|
||||
class Railtie < Rails::Railtie
|
||||
|
@ -21,7 +22,6 @@ module ActionController
|
|||
paths = app.config.paths
|
||||
options = app.config.action_controller
|
||||
|
||||
options.use_sprockets ||= app.config.assets.enabled
|
||||
options.assets_dir ||= paths["public"].first
|
||||
options.javascripts_dir ||= paths["public/javascripts"].first
|
||||
options.stylesheets_dir ||= paths["public/stylesheets"].first
|
||||
|
|
9
actionpack/lib/sprockets/railtie.rb
Normal file
9
actionpack/lib/sprockets/railtie.rb
Normal 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
|
Loading…
Reference in a new issue