Permalink
Browse files

Move controller configs to sprockets own railtie.

  • Loading branch information...
josevalim committed Apr 17, 2011
1 parent eb75f15 commit 16b9547a881eb2e201c6f17ec7850bc05c8f6a52
Showing with 10 additions and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/railtie.rb
  2. +9 −0 actionpack/lib/sprockets/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
@@ -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

0 comments on commit 16b9547

Please sign in to comment.