diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2017-11-14 09:21:39 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-14 09:21:39 -0500 |
commit | d4eef6053136a59dad3b7c41cf1949b0fac3b768 (patch) | |
tree | d99472df63237b89c33af40ee491d01b3636304c /guides/source/layouts_and_rendering.md | |
parent | a1ee43d2170dd6adf5a9f390df2b1dde45018a48 (diff) | |
parent | 0bcfa999b8deb7ea5d15dab9597bc637d226b565 (diff) | |
download | rails-d4eef6053136a59dad3b7c41cf1949b0fac3b768.tar.gz rails-d4eef6053136a59dad3b7c41cf1949b0fac3b768.tar.bz2 rails-d4eef6053136a59dad3b7c41cf1949b0fac3b768.zip |
Merge pull request #30884 from robwold/patch-1
Update layouts_and_rendering.md [ci skip]
Diffstat (limited to 'guides/source/layouts_and_rendering.md')
-rw-r--r-- | guides/source/layouts_and_rendering.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/layouts_and_rendering.md b/guides/source/layouts_and_rendering.md index b9b327252f..f4597b0e60 100644 --- a/guides/source/layouts_and_rendering.md +++ b/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: |