aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-11-20 21:01:15 -0500
committerNeeraj Singh <neerajdotname@gmail.com>2010-11-20 21:01:15 -0500
commit7b503f02ca2a8ac46e17e447b92d4a68fcc4a356 (patch)
tree935068945b52b650aebdecb75496d5fbd1fa89a3 /actionpack
parent69d47a00c7e43e2431aa1b164a2e6309da1bf118 (diff)
parent074782eda2caddb054d20a99e8d167ef8e1eecd2 (diff)
downloadrails-7b503f02ca2a8ac46e17e447b92d4a68fcc4a356.tar.gz
rails-7b503f02ca2a8ac46e17e447b92d4a68fcc4a356.tar.bz2
rails-7b503f02ca2a8ac46e17e447b92d4a68fcc4a356.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/partials.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/partials.rb b/actionpack/lib/action_view/partials.rb
index 844c3e9572..cd3f130dc4 100644
--- a/actionpack/lib/action_view/partials.rb
+++ b/actionpack/lib/action_view/partials.rb
@@ -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.
#