Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

javascript_include_tag should add '.js' to sources that contain '.'

  • Loading branch information...
commit aa491f6a9c90641a2d4115420b14e45514962834 1 parent 8cae31c
Sergey Nartimov lest authored
2  actionpack/lib/sprockets/helpers/rails_helper.rb
View
@@ -154,7 +154,7 @@ def rewrite_asset_path(source, dir, options = {})
end
def rewrite_extension(source, dir, ext)
- if ext && File.extname(source).empty?
+ if ext && File.extname(source) != ".#{ext}"
"#{source}.#{ext}"
else
source
3  actionpack/test/template/sprockets_helper_test.rb
View
@@ -217,6 +217,9 @@ def config
assert_match %r{<script src="/assets/xmlhr-[0-9a-f]+.js\?body=1" type="text/javascript"></script>\n<script src="/assets/application-[0-9a-f]+.js\?body=1" type="text/javascript"></script>},
javascript_include_tag(:application, :debug => true)
+ assert_match %r{<script src="/assets/jquery.plugin.js" type="text/javascript"></script>},
+ javascript_include_tag('jquery.plugin', :digest => false)
+
@config.assets.compile = true
@config.assets.debug = true
assert_match %r{<script src="/javascripts/application.js" type="text/javascript"></script>},
Please sign in to comment.
Something went wrong with that request. Please try again.