From 6c64e1e3a33c2e703a9939f075fb57167b75b36a Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 27 Jun 2011 13:54:54 -0700 Subject: 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 --- actionpack/lib/sprockets/helpers/rails_helper.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/sprockets/helpers/rails_helper.rb') 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 -- cgit v1.2.3