diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-05-03 10:25:01 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-05-03 10:25:01 +0000 |
commit | 2eebd11e0bcdb81a605d61772e09853d4b45e21c (patch) | |
tree | 9831c8fab33b4147d02caec7982ab1d60757b685 /actionpack/lib | |
parent | 6b6d6d29f68ffbe13f86a5eebf7d26ec04027429 (diff) | |
download | rails-2eebd11e0bcdb81a605d61772e09853d4b45e21c.tar.gz rails-2eebd11e0bcdb81a605d61772e09853d4b45e21c.tar.bz2 rails-2eebd11e0bcdb81a605d61772e09853d4b45e21c.zip |
Added the option of specifying a RAILS_ASSET_HOST that will then be used by all the asset helpers. This enables you to easily offload static content like javascripts and images to a separate server tuned just for that.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1279 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/asset_tag_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index f888e7a3e2..a1c22747ae 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -104,8 +104,8 @@ 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 + source = "#{@request.relative_url_root}#{source}" + defined?(RAILS_ASSET_HOST) ? RAILS_ASSET_HOST + source : source end end end |