aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/sprockets/helpers/rails_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/sprockets/helpers/rails_helper.rb')
-rw-r--r--actionpack/lib/sprockets/helpers/rails_helper.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb
index 69306ef631..c239af77bc 100644
--- a/actionpack/lib/sprockets/helpers/rails_helper.rb
+++ b/actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -126,7 +126,7 @@ module Sprockets
else
source = digest_for(source) if performing_caching?
source = File.join(dir, source)
- source = "/#{url}" unless source =~ /^\//
+ source = "/#{source}" unless source =~ /^\//
source
end
end
@@ -139,9 +139,14 @@ module Sprockets
end
end
- # When included in Sprockets::Context, we need to ask the top-level config as the controller is not available
def performing_caching?
- config.action_controller.present? ? config.action_controller.perform_caching : config.perform_caching
+ # When included in Sprockets::Context, we need to ask the
+ # top-level config as the controller is not available.
+ if config.action_controller.present?
+ config.action_controller.perform_caching
+ else
+ config.perform_caching
+ end
end
end
end