diff options
author | Sebastian Martinez <sebastian@wyeworks.com> | 2011-04-16 17:32:04 -0300 |
---|---|---|
committer | Sebastian Martinez <sebastian@wyeworks.com> | 2011-04-16 17:32:04 -0300 |
commit | 143ed7edc32f875882f972ce444c9fa8ea028326 (patch) | |
tree | 13fd10288291ce8148583bf4369c52e091c97652 /railties/guides/source/action_view_overview.textile | |
parent | eecb8385b4901f6c4e9679a5fc9f065a639f9ac7 (diff) | |
download | rails-143ed7edc32f875882f972ce444c9fa8ea028326.tar.gz rails-143ed7edc32f875882f972ce444c9fa8ea028326.tar.bz2 rails-143ed7edc32f875882f972ce444c9fa8ea028326.zip |
Added Spacer Templates on Partials section of ActionView guide.
Diffstat (limited to 'railties/guides/source/action_view_overview.textile')
-rw-r--r-- | railties/guides/source/action_view_overview.textile | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/guides/source/action_view_overview.textile b/railties/guides/source/action_view_overview.textile index 72fcb8c0e6..ab9b910270 100644 --- a/railties/guides/source/action_view_overview.textile +++ b/railties/guides/source/action_view_overview.textile @@ -212,6 +212,16 @@ You can use a shorthand syntax for rendering collections. Assuming @products is Rails determines the name of the partial to use by looking at the model name in the collection. In fact, you can even create a heterogeneous collection and render it this way, and Rails will choose the proper partial for each member of the collection. +h5. Spacer Templates + +You can also specify a second partial to be rendered between instances of the main partial by using the +:spacer_template+ option: + +<erb> +<%= render @products, :spacer_template => "product_ruler" %> +</erb> + +Rails will render the +_product_ruler+ partial (with no data passed in to it) between each pair of +_product+ partials. + h3. Using Templates, Partials and Layouts in "The Rails Way" TODO... |