From db3e310d6b327b2b58cfbc0318abd3b4ddca5e30 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 29 Mar 2011 18:05:23 -0500 Subject: Change back to /assets prefix --- .../lib/action_view/helpers/sprockets_helper.rb | 4 ++-- railties/lib/rails/engine.rb | 19 ++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/actionpack/lib/action_view/helpers/sprockets_helper.rb b/actionpack/lib/action_view/helpers/sprockets_helper.rb index 9fd5f6759c..4f19f4bb21 100644 --- a/actionpack/lib/action_view/helpers/sprockets_helper.rb +++ b/actionpack/lib/action_view/helpers/sprockets_helper.rb @@ -4,7 +4,7 @@ module ActionView module Helpers module SprocketsHelper def sprockets_javascript_path(source) - compute_sprockets_path source, 'javascripts', 'js' + compute_sprockets_path source, 'assets', 'js' end def sprockets_javascript_include_tag(source, options = {}) @@ -17,7 +17,7 @@ module ActionView end def sprockets_stylesheet_path(source) - compute_sprockets_path source, 'stylesheets', 'css' + compute_sprockets_path source, 'assets', 'css' end def sprockets_stylesheet_link_tag(source, options = {}) diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 85f7d22fc9..79d48889c9 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -444,7 +444,7 @@ module Rails engine = self routes.append do if engine.config.use_sprockets - routes.add_route(engine.assets, {}, {}, {}, nil, false) + routes.add_route(engine.assets, {:path_info => "/assets"}, {}, {}, nil, false) end end @@ -453,15 +453,12 @@ module Rails def self.default_sprockets_paths [ - "app/assets", - "app/assets/javascripts", - "app/assets/stylesheets", - "vendor/plugins/*/app/assets", - "vendor/plugins/*/app/assets/javascripts", - "vendor/plugins/*/app/assets/stylesheets", - "vendor/plugins/*/assets", - "vendor/plugins/*/assets/javascripts", - "vendor/plugins/*/assets/stylesheets" + "app/javascripts", + "app/stylesheets", + "vendor/plugins/*/app/javascripts", + "vendor/plugins/*/app/stylesheets", + "vendor/plugins/*/javascripts", + "vendor/plugins/*/stylesheets" ] end @@ -475,7 +472,7 @@ module Rails require 'sprockets' env = Sprockets::Environment.new(root.to_s) - env.static_root = root.join("public") + env.static_root = root.join("public/assets") self.class.default_sprockets_paths.each do |pattern| Dir[root.join(pattern)].each do |dir| -- cgit v1.2.3