Added the option of specifying a RAILS_ASSET_HOST that will then be used by...

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
上级 6b6d6d29
*SVN*
* 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.
* Fixed action/fragment caching using the filestore when a directory and a file wanted to to use the same name. Now there's a .cache prefix that sidesteps the conflict #1188 [imbcmdth@hotmail.com]
* Fixed missing id uniqueness in FormTag#radio_button #1207 [Jarkko]
......
......@@ -104,8 +104,8 @@ def image_tag(source, options = {})
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册