diff options
author | retr0h <john@dewey.ws> | 2010-03-04 19:49:20 -0800 |
---|---|---|
committer | Rizwan Reza <rizwanreza@gmail.com> | 2010-03-25 21:55:21 +0430 |
commit | cbdb4aa28765cf540a1a66e647fb7160ebe7a4a8 (patch) | |
tree | d72f60457f074974d9d8f5c42e31a57b6e174569 /actionpack/lib/action_view/helpers | |
parent | 94381b2d5a54021eff24cb530e2cef328f3fa24f (diff) | |
download | rails-cbdb4aa28765cf540a1a66e647fb7160ebe7a4a8.tar.gz rails-cbdb4aa28765cf540a1a66e647fb7160ebe7a4a8.tar.bz2 rails-cbdb4aa28765cf540a1a66e647fb7160ebe7a4a8.zip |
Updated ActionController::Base.asset_host example
The example provided contrived. It is not useful when wanting to use
1-based asset hosts (since it would generate a random asset host for
the same asset).
Signed-off-by: Rizwan Reza <rizwanreza@gmail.com>
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-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 03ae8ce0d8..b594002629 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -58,7 +58,7 @@ module ActionView # +asset_host+ to a proc like this: # # ActionController::Base.asset_host = Proc.new { |source| - # "http://assets#{rand(2) + 1}.example.com" + # "http://assets#{source.hash % 2 + 1}.example.com" # } # image_tag("rails.png") # # => <img alt="Rails" src="http://assets0.example.com/images/rails.png?1230601161" /> @@ -66,7 +66,7 @@ module ActionView # # => <link href="http://assets1.example.com/stylesheets/application.css?1232285206" media="screen" rel="stylesheet" type="text/css" /> # # The example above generates "http://assets1.example.com" and - # "http://assets2.example.com" randomly. This option is useful for example if + # "http://assets2.example.com". This option is useful for example if # you need fewer/more than four hosts, custom host names, etc. # # As you see the proc takes a +source+ parameter. That's a string with the |