Skip to content

Commit 4eb8987

Browse files
committed
Add documentation for :spacer_template in Rails 3
This setting was existed since Rails 2.3.x, and seems like it have been left out when we rewriting the documentation.
1 parent 02656ac commit 4eb8987

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

actionpack/lib/action_view/render/partials.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ module ActionView
7171
#
7272
# The :as option may be used when rendering partials.
7373
#
74+
# Also, you can specify a partial which will be render as a spacer between each element by passing partial name to
75+
# +:spacer_template+. The following example will render "advertiser/_ad_divider.erb" between each ad partial.
76+
#
77+
# <%= render :partial => "ad", :collection => @advertisements, :spacer_template => "ad_divider" %>
78+
#
7479
# NOTE: Due to backwards compatibility concerns, the collection can't be one of hashes. Normally you'd also
7580
# just keep domain objects, like Active Records, in there.
7681
#

0 commit comments

Comments
 (0)