提交 cbdb4aa2 编写于 作者: R retr0h 提交者: Rizwan Reza

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: NRizwan Reza <rizwanreza@gmail.com>
上级 94381b2d
......@@ -58,7 +58,7 @@ 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" />
......@@ -66,7 +66,7 @@ module Helpers #:nodoc:
# # => <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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册