From 024bed387b067519de64af5b89ce2b534c99155f Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 27 Jun 2011 13:58:51 -0700 Subject: Added a configuration setting: config.action_controller.default_asset_host_protocol It's best to leave this unset. When unset the :request protocol is used whenever it can be and :relative is used in the other situations. When set to :request then assets hosts will be disabled when there is no request in scope and will use the request protocol whenever a request is in scope. If set to :relative, then a relative protocol is always used except for stylesheet link tags which must use the :request protocol to avoid double downloads in IE6&7. Conflicts: actionpack/lib/sprockets/helpers/rails_helper.rb actionpack/test/template/sprockets_helper_test.rb --- actionpack/lib/sprockets/helpers/rails_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/sprockets/helpers') diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index cf185749ea..63820cc76c 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -64,9 +64,9 @@ module Sprockets end.join("\n").html_safe end - def asset_path(source, default_ext = nil, body = false, protocol = :relative) + def asset_path(source, default_ext = nil, body = false, protocol = nil) source = source.logical_path if source.respond_to?(:logical_path) - path = asset_paths.compute_public_path(source, 'assets', default_ext, protocol) + path = asset_paths.compute_public_path(source, 'assets', default_ext, true, protocol) body ? "#{path}?body=1" : path end @@ -77,7 +77,7 @@ module Sprockets end class AssetPaths < ::ActionView::AssetPaths #:nodoc: - def compute_public_path(source, dir, ext=nil, include_host=true, protocol = :relative) + def compute_public_path(source, dir, ext=nil, include_host=true, protocol = nil) super(source, Rails.application.config.assets.prefix, ext, include_host, protocol) end -- cgit v1.2.3