This project is archived and is in readonly mode.

javascript_include_tag shouldn't append a ".js" onto external urls
Reported by MatthewRudy | December 29th, 2008 @ 05:52 PM | in 2.x
the problem
javascript_include_tag("http://www.google.com/jsapi")
=> %(<script type="text/javascript" src="http://www.google.com/jsapi.js"></script>)
but that url isn't valid.
If we've specified an external url, then we should also have specified the extension if there is one.
All the tests seem to pass, and I don't seem to have broken the external asset-host functionality.
Comments and changes to this ticket
- 
            
         MatthewRudy January 5th, 2009 @ 02:11 AMa recent commit changed the underlying code in asset_tag helper. as such this patch no longer works the offending code is; if ext && (File.extname(source).blank? || File.exist?(File.join(ASSETS_DIR, dir, "#{source}.#{ext}"))) source += ".#{ext}" endI think it should be changed to exclude; source += ".#{ext}" unless source =~ %r{^[-a-z]+://}however I need to dry up all these calls to %r{^[-a-z]+://} something for the morning 
- 
         Pratik March 8th, 2009 @ 12:25 AM- Assigned user set to Pratik
- State changed from new to incomplete
 Patch doesn't apply anymore ( of course, it's been months :( ). But ok, I'll try to apply as soon as there's a new patch. Thanks ! 
- 
         CancelProfileIsBroken August 5th, 2009 @ 03:15 PM- Tag changed from actionpack, assets, asset_tag_helper, javascript to actionpack, assets, asset_tag_helper, bugmash, javascript
 
- 
            
         
- 
            
         
- 
         Repository August 5th, 2009 @ 05:16 PM- State changed from incomplete to resolved
 (from [64268a0b06d32567c6e88b7293f332b79e10414b]) Make sure javascript_include_tag/stylesheet_link_tag does not append ".js" or ".css" onto external urls [#1664 state:resolved] Signed-off-by: Pratik Naik pratiknaik@gmail.com 
 http://github.com/rails/rails/commit/64268a0b06d32567c6e88b7293f332...
- 
         CancelProfileIsBroken August 5th, 2009 @ 05:20 PM- Tag changed from actionpack, assets, asset_tag_helper, bugmash, javascript to actionpack, assets, asset_tag_helper, javascript
 
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 
         1664 
          javascript_include_tag shouldn't append a ".js" onto external urls
        (from [64268a0b06d32567c6e88b7293f332b79e10414b])
Make su... 1664 
          javascript_include_tag shouldn't append a ".js" onto external urls
        (from [64268a0b06d32567c6e88b7293f332b79e10414b])
Make su...
 CancelProfileIsBroken
      CancelProfileIsBroken
 Mike Breen
      Mike Breen
 Pratik
      Pratik