提交 e65c23dc 编写于 作者: P Prem Sichanugrist 提交者: Xavier Noria

Mention the case that `render` will return nil if given `:collection` is nil...

Mention the case that `render` will return nil if given `:collection` is nil or empty when rendering partial.
上级 f975f351
......@@ -75,6 +75,11 @@ module ActionView
#
# <%= render :partial => "ad", :collection => @advertisements, :spacer_template => "ad_divider" %>
#
# If the given <tt>:collection</tt> is nil or empty, <tt>render</tt> will return nil. This will allow you
# to specify a text which will displayed instead by using this form:
#
# <%= render(:partial => "ad", :collection => @advertisements) || "There's no ad to be displayed" %>
#
# NOTE: Due to backwards compatibility concerns, the collection can't be one of hashes. Normally you'd also
# just keep domain objects, like Active Records, in there.
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册