Permalink
Browse files

Merge pull request #30884 from robwold/patch-1

Update layouts_and_rendering.md  [ci skip]
  • Loading branch information...
eileencodes committed Nov 14, 2017
2 parents a1ee43d + 0bcfa99 commit d4eef6053136a59dad3b7c41cf1949b0fac3b768
Showing with 1 addition and 1 deletion.
  1. +1 −1 guides/source/layouts_and_rendering.md
@@ -1266,7 +1266,7 @@ You can also pass in arbitrary local variables to any partial you are rendering
In this case, the partial will have access to a local variable `title` with the value "Products Page".
TIP: Rails also makes a counter variable available within a partial called by the collection, named after the member of the collection followed by `_counter`. For example, if you're rendering `@products`, within the partial you can refer to `product_counter` to tell you how many times the partial has been rendered. This does not work in conjunction with the `as: :value` option.
TIP: Rails also makes a counter variable available within a partial called by the collection, named after the title of the partial followed by `_counter`. For example, when rendering a collection `@products` the partial `_product.html.erb` can access the variable `product_counter` which indexes the number of times it has been rendered within the enclosing view.
You can also specify a second partial to be rendered between instances of the main partial by using the `:spacer_template` option:

4 comments on commit d4eef60

@robwold

This comment has been minimized.

Show comment
Hide comment
@robwold

robwold Mar 22, 2018

Contributor

Hi @eileencodes - sorry to bother you, but this doesn't actually seem to be reflected in the live guides. Did I miss something?

Contributor

robwold replied Mar 22, 2018

Hi @eileencodes - sorry to bother you, but this doesn't actually seem to be reflected in the live guides. Did I miss something?

@eileencodes

This comment has been minimized.

Show comment
Hide comment
@eileencodes

eileencodes Mar 22, 2018

Member

This is in 5.2 and 5.2 hasn't been released yet. It will show up in the guides when we release the final of 5.2.0.

Member

eileencodes replied Mar 22, 2018

This is in 5.2 and 5.2 hasn't been released yet. It will show up in the guides when we release the final of 5.2.0.

@robwold

This comment has been minimized.

Show comment
Hide comment
@robwold

robwold Mar 22, 2018

Contributor

Ah cool, wasn't sure if I'd managed to accidentally destroy my changes when squashing the git history or something like that. Thanks!

Contributor

robwold replied Mar 22, 2018

Ah cool, wasn't sure if I'd managed to accidentally destroy my changes when squashing the git history or something like that. Thanks!

@bogdanvlviv

This comment has been minimized.

Show comment
Hide comment
@bogdanvlviv

bogdanvlviv Mar 22, 2018

Contributor

@robwold You can use Edge Guides of Rails(http://edgeguides.rubyonrails.org/) in order to see guides with the latest changes.

Contributor

bogdanvlviv replied Mar 22, 2018

@robwold You can use Edge Guides of Rails(http://edgeguides.rubyonrails.org/) in order to see guides with the latest changes.

Please sign in to comment.