This project is archived and is in readonly mode.

#6748 new
Chad K

Asset helpers should understand scheme-relative URLs

Reported by Chad K | April 26th, 2011 @ 06:17 AM

If you have this configuration:

ActionController::Base.asset_host = ""

And do this:


You get something like:

<img src="" >

When instead this should be rendered:

<img src="//" >

Which allows the browser to resolve the URL relative the current scheme, e.g. http, https.

An example of this case can be seen in the URI spec here:


"//g" => "http://g"

assuming the current scheme is http.

I've attached a patch to actionpack to support scheme-relative URL's in asset helpers.

Github commit can be seen here:

No comments found

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=""></a>

People watching this ticket