aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/asset_tag_helper.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-07-16 17:39:14 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-07-16 17:39:14 -0500
commit8fe01de2e8753d045408ecde3178ab4e9192bf9a (patch)
tree1adf750f228a7635554d7c9b601c4806a37d71fc /actionpack/lib/action_view/helpers/asset_tag_helper.rb
parent8f640c381d9d1b74f6a0fc3648c21da373661914 (diff)
downloadrails-8fe01de2e8753d045408ecde3178ab4e9192bf9a.tar.gz
rails-8fe01de2e8753d045408ecde3178ab4e9192bf9a.tar.bz2
rails-8fe01de2e8753d045408ecde3178ab4e9192bf9a.zip
Fixed that AssetTagHelper#compute_public_path shouldn't cache the asset_host along with the source or per-request proc's won't run [DHH]
Diffstat (limited to 'actionpack/lib/action_view/helpers/asset_tag_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helper.rb25
1 files changed, 14 insertions, 11 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
index e5a95a961c..b86e1b7da4 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -485,21 +485,24 @@ module ActionView
source = "#{@controller.request.relative_url_root}#{source}"
end
end
- source = rewrite_asset_path(source)
- if include_host
- host = compute_asset_host(source)
+ rewrite_asset_path(source)
+ end
+ end
- if has_request && !host.blank? && host !~ %r{^[-a-z]+://}
- host = "#{@controller.request.protocol}#{host}"
- end
+ source = ActionView::Base.computed_public_paths[cache_key]
- "#{host}#{source}"
- else
- source
- end
- end
+ if include_host && source !~ %r{^[-a-z]+://}
+ host = compute_asset_host(source)
+
+ if has_request && !host.blank? && host !~ %r{^[-a-z]+://}
+ host = "#{@controller.request.protocol}#{host}"
end
+
+ "#{host}#{source}"
+ else
+ source
+ end
end
# Pick an asset host for this source. Returns +nil+ if no host is set,