diff options
author | Rob <rold@fleetsmart.co.uk> | 2017-11-14 13:26:01 +0000 |
---|---|---|
committer | Rob <rold@fleetsmart.co.uk> | 2017-11-14 13:26:01 +0000 |
commit | 0bcfa999b8deb7ea5d15dab9597bc637d226b565 (patch) | |
tree | a98a97802ca3b120e4085ca25b2a5a687fbf7ad4 /guides/source/layouts_and_rendering.md | |
parent | 29da7d1ff510a9f376fc6c780273dfa89298ff51 (diff) | |
download | rails-0bcfa999b8deb7ea5d15dab9597bc637d226b565.tar.gz rails-0bcfa999b8deb7ea5d15dab9597bc637d226b565.tar.bz2 rails-0bcfa999b8deb7ea5d15dab9597bc637d226b565.zip |
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: |