diff options
Diffstat (limited to 'railties/lib/rails/application.rb')
-rw-r--r-- | railties/lib/rails/application.rb | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 032a505f26..754b03258a 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -142,7 +142,7 @@ module Rails end def build_asset_environment - return nil if !config.use_sprockets + return unless config.asset_pipeline require 'sprockets' env = Sprockets::Environment.new(root.to_s) env.static_root = root.join("public/assets") @@ -150,16 +150,18 @@ module Rails end initializer :add_sprockets_paths do |app| - [ - "app/javascripts", - "app/stylesheets", - "vendor/plugins/*/app/javascripts", - "vendor/plugins/*/app/stylesheets", - "vendor/plugins/*/javascripts", - "vendor/plugins/*/stylesheets" - ].each do |pattern| - Dir[app.root.join(pattern)].each do |dir| - app.assets.paths << dir + if config.asset_pipeline + [ + "app/javascripts", + "app/stylesheets", + "vendor/plugins/*/app/javascripts", + "vendor/plugins/*/app/stylesheets", + "vendor/plugins/*/javascripts", + "vendor/plugins/*/stylesheets" + ].each do |pattern| + Dir[app.root.join(pattern)].each do |dir| + app.assets.paths << dir + end end end end |