Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move controller configs to sprockets own railtie.

  • Loading branch information...
commit 16b9547a881eb2e201c6f17ec7850bc05c8f6a52 1 parent eb75f15
@josevalim josevalim authored
View
2  actionpack/lib/action_controller/railtie.rb
@@ -4,6 +4,7 @@
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 @@ class Railtie < Rails::Railtie
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
View
9 actionpack/lib/sprockets/railtie.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.