Skip to content

Commit

Permalink
Updated ActionController::Base.asset_host example
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
retr0h authored and rizwanreza committed Mar 25, 2010
1 parent 94381b2 commit cbdb4aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actionpack/lib/action_view/helpers/asset_tag_helper.rb
Expand Up @@ -58,15 +58,15 @@ module Helpers #:nodoc:
# +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" />
# stylesheet_link_tag("application")
# # => <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
Expand Down

0 comments on commit cbdb4aa

Please sign in to comment.