diff options
author | Chris Eppstein <chris@eppsteins.net> | 2011-06-27 13:54:54 -0700 |
---|---|---|
committer | Chris Eppstein <chris@eppsteins.net> | 2011-06-27 13:54:54 -0700 |
commit | 6c64e1e3a33c2e703a9939f075fb57167b75b36a (patch) | |
tree | 5a7f61d6ad2a700be76d84b241a3e763997911fd /actionpack/lib/sprockets | |
parent | 96137e8bd0a0094d26cc0cf6f86642487a60735f (diff) | |
download | rails-6c64e1e3a33c2e703a9939f075fb57167b75b36a.tar.gz rails-6c64e1e3a33c2e703a9939f075fb57167b75b36a.tar.bz2 rails-6c64e1e3a33c2e703a9939f075fb57167b75b36a.zip |
Stylesheet link tags should use the request protocol to avoid duplicate download of stylesheets in IE7 and IE8.
Conflicts:
actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb
actionpack/lib/sprockets/helpers/rails_helper.rb
Diffstat (limited to 'actionpack/lib/sprockets')
-rw-r--r-- | actionpack/lib/sprockets/helpers/rails_helper.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index ef7cf9e051..3a77db5fd8 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -50,7 +50,7 @@ module Sprockets 'rel' => "stylesheet", 'type' => "text/css", 'media' => "screen", - 'href' => asset_path(source, 'css', body) + 'href' => asset_path(source, 'css', body, :request) }.merge(options.stringify_keys) tag 'link', tag_options @@ -58,9 +58,9 @@ module Sprockets end.join("\n").html_safe end - def asset_path(source, default_ext = nil, body = false) + def asset_path(source, default_ext = nil, body = false, protocol = :relative) source = source.logical_path if source.respond_to?(:logical_path) - path = asset_paths.compute_public_path(source, 'assets', default_ext) + path = asset_paths.compute_public_path(source, 'assets', default_ext, protocol) body ? "#{path}?body=1" : path end @@ -71,8 +71,8 @@ module Sprockets end class AssetPaths < ::ActionView::AssetPaths #:nodoc: - def compute_public_path(source, dir, ext=nil, include_host=true) - super(source, Rails.application.config.assets.prefix, ext, include_host) + def compute_public_path(source, dir, ext=nil, include_host=true, protocol = :relative) + super(source, Rails.application.config.assets.prefix, ext, include_host, protocol) end # Return the filesystem path for the source |