diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-06-27 14:01:34 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-06-27 14:01:34 -0700 |
commit | 4bcb05de2d512cfa8c35e130c4b11f961f1b6e29 (patch) | |
tree | 81d060bd7b82540f1887f0421109eaf7654acff9 /actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb | |
parent | a0960ec2d4476763d6975e3df6806cf99f24ead9 (diff) | |
parent | 024bed387b067519de64af5b89ce2b534c99155f (diff) | |
download | rails-4bcb05de2d512cfa8c35e130c4b11f961f1b6e29.tar.gz rails-4bcb05de2d512cfa8c35e130c4b11f961f1b6e29.tar.bz2 rails-4bcb05de2d512cfa8c35e130c4b11f961f1b6e29.zip |
Merge pull request #1870 from chriseppstein/asset_urls_master
Asset urls master
Diffstat (limited to 'actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb b/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb index e4f11c9bc7..8c25d38bbd 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb @@ -16,7 +16,8 @@ module ActionView end def asset_tag(source, options) - tag("link", { "rel" => "stylesheet", "type" => Mime::CSS, "media" => "screen", "href" => ERB::Util.html_escape(path_to_asset(source)) }.merge(options), false, false) + # We force the :request protocol here to avoid a double-download bug in IE7 and IE8 + tag("link", { "rel" => "stylesheet", "type" => Mime::CSS, "media" => "screen", "href" => ERB::Util.html_escape(path_to_asset(source, true, :request)) }.merge(options), false, false) end def custom_dir @@ -52,7 +53,7 @@ module ActionView # If the +source+ filename has no extension, <tt>.css</tt> will be appended (except for explicit URIs). # Full paths from the document root will be passed through. # Used internally by +stylesheet_link_tag+ to build the stylesheet path. - # + # # ==== Examples # stylesheet_path "style" # => /stylesheets/style.css # stylesheet_path "dir/style.css" # => /stylesheets/dir/style.css @@ -60,11 +61,7 @@ module ActionView # stylesheet_path "http://www.example.com/css/style" # => http://www.example.com/css/style # stylesheet_path "http://www.example.com/css/style.css" # => http://www.example.com/css/style.css def stylesheet_path(source) - if config.use_sprockets - asset_path(source, 'css') - else - asset_paths.compute_public_path(source, 'stylesheets', 'css') - end + asset_paths.compute_public_path(source, 'stylesheets', 'css', true, :request) end alias_method :path_to_stylesheet, :stylesheet_path # aliased to avoid conflicts with a stylesheet_path named route |