From 473e5bde747d227d47d00e9b5f52b668b29f53df Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 19 May 2005 18:06:12 +0000 Subject: Fixed that compute_public_path should recognize external URLs, so image_tag("http://www.example.com/images/icon.gif") is not prefixed with the relative url path #1254 [victor-ronr-trac@carotena.net] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1321 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/asset_tag_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers') diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index c3ee24df84..de507c6ceb 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -109,7 +109,7 @@ module ActionView def compute_public_path(source, dir, ext) source = "/#{dir}/#{source}" unless source.include?("/") source = "#{source}.#{ext}" unless source.include?(".") - source = "#{@request.relative_url_root}#{source}" + source = "#{@request.relative_url_root}#{source}" unless %r{^[-a-z]+://} =~ source ActionController::Base.asset_host + source end end -- cgit v1.2.3