aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorLucas Oliveira <just.lucasoliveira@gmail.com>2018-10-16 20:52:34 -0400
committerLucas Oliveira <just.lucasoliveira@gmail.com>2018-10-16 20:52:34 -0400
commit8d5a2c4da12725beeb14ba70508762242c86696f (patch)
tree9b6940b798ff9a37824be84d76aa5a511a45cd71 /guides/source
parentd234dd677a54d2ec787b8a2ee552b620fe6c3bb5 (diff)
downloadrails-8d5a2c4da12725beeb14ba70508762242c86696f.tar.gz
rails-8d5a2c4da12725beeb14ba70508762242c86696f.tar.bz2
rails-8d5a2c4da12725beeb14ba70508762242c86696f.zip
Update guide for the counter variable when rendering with the `as:` option
[ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/layouts_and_rendering.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/layouts_and_rendering.md b/guides/source/layouts_and_rendering.md
index 00da65b784..ad08e5a5a9 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 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.
+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. Note that it also applies for when the partial name was changed by using the `as:` option. For example, the counter variable for the code above would be `item_counter`.
You can also specify a second partial to be rendered between instances of the main partial by using the `:spacer_template` option: