From bb0db1a7cb494251143d50a922a0ec3b20108768 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 17 Jan 2009 03:12:54 +0100 Subject: reworded docs of AssetTagHelper, Mike helped here --- .../lib/action_view/helpers/asset_tag_helper.rb | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index 7e1110afab..b79fb454d0 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -9,22 +9,28 @@ module ActionView # the assets exist before linking to them. # # === Using asset hosts + # # By default, Rails links to these assets on the current host in the public - # folder, but you can direct Rails to link to assets from a dedicated assets server by - # setting ActionController::Base.asset_host in your config/environment.rb. For example, - # let's say your asset host is assets.example.com. + # folder, but you can direct Rails to link to assets from a dedicated asset server by + # setting ActionController::Base.asset_host in your config/environment.rb. + # For example, you'd define assets.example.com to be your asset + # host this way: # # ActionController::Base.asset_host = "assets.example.com" + # + # Helpers take that into account: + # # image_tag("rails.png") # => Rails # stylesheet_link_tag("application") # => # - # This is useful since browsers typically open at most two connections to a single host, - # which means your assets often wait in single file for their turn to load. You can - # alleviate this by using a %d wildcard in asset_host (for example, "assets%d.example.com") - # to automatically distribute asset requests among four hosts (e.g., "assets0.example.com" through "assets3.example.com") - # so browsers will open eight connections rather than two. + # Browsers typically open at most two simultaneous connections to a single host, + # which means your assets often have to wait for other assets to finish downloading. + # You can alleviate this by using a %d wildcard in asset_host + # (for example, "assets%d.example.com") to automatically distribute asset requests + # among four hosts (e.g., "assets0.example.com" through "assets3.example.com") so + # browsers will open eight simultaneous connections rather than two. # # image_tag("rails.png") # => Rails -- cgit v1.2.3