diff options
Diffstat (limited to 'actionpack/lib/sprockets/helpers')
-rw-r--r-- | actionpack/lib/sprockets/helpers/rails_helper.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index 4e11221842..8ac137b4b5 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -155,8 +155,13 @@ module Sprockets end def rewrite_extension(source, dir, ext) - if ext && File.extname(source) != ".#{ext}" - "#{source}.#{ext}" + source_ext = File.extname(source) + if ext && source_ext != ".#{ext}" + if !source_ext.empty? && asset_environment[source] + source + else + "#{source}.#{ext}" + end else source end |