From bc54d520d675657e95f6513268162303ad40d56d Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Sun, 12 Sep 2010 14:59:12 +0700 Subject: [PATCH] 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. --- actionpack/lib/action_view/render/partials.rb | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/actionpack/lib/action_view/render/partials.rb b/actionpack/lib/action_view/render/partials.rb index 92cdbfb..b8ce81f 100644 --- a/actionpack/lib/action_view/render/partials.rb +++ b/actionpack/lib/action_view/render/partials.rb @@ -39,6 +39,11 @@ module ActionView # iteration counter will automatically be made available to the template with a name of the form # +partial_name_counter+. In the case of the example above, the template would be fed +ad_counter+. # + # Also, you can specify a partial which will be render as a spacer between each element by passing partial name to + # +:spacer_template+. The following example will render "advertiser/_ad_divider.erb" between each ad partial. + # + # <%= render :partial => "ad", :collection => @advertisements, :spacer_template => "ad_divider" %> + # # 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. # -- 1.7.2.3