aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorseapy <iamseapy@gmail.com>2014-01-08 21:57:25 +0900
committerseapy <iamseapy@gmail.com>2014-01-08 21:57:25 +0900
commit6c252b5cb9efaf291359275e106116c7746d8915 (patch)
treeff1fea1e17613695a7d180a5123cfca656252b9f /guides
parenta03fed88f780922e3a3ab7b22af945f29a711ae4 (diff)
downloadrails-6c252b5cb9efaf291359275e106116c7746d8915.tar.gz
rails-6c252b5cb9efaf291359275e106116c7746d8915.tar.bz2
rails-6c252b5cb9efaf291359275e106116c7746d8915.zip
Fixed typo [ci skip]
singular is more suited to
Diffstat (limited to 'guides')
-rw-r--r--guides/source/layouts_and_rendering.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/layouts_and_rendering.md b/guides/source/layouts_and_rendering.md
index c2d9772063..9788ebdc32 100644
--- a/guides/source/layouts_and_rendering.md
+++ b/guides/source/layouts_and_rendering.md
@@ -1121,11 +1121,11 @@ With this change, you can access an instance of the `@products` collection as th
You can also pass in arbitrary local variables to any partial you are rendering with the `locals: {}` option:
```erb
-<%= render partial: "products", collection: @products,
+<%= render partial: "product", collection: @products,
as: :item, locals: {title: "Products Page"} %>
```
-Would render a partial `_products.html.erb` once for each instance of `product` in the `@products` instance variable passing the instance to the partial as a local variable called `item` and to each partial, make the local variable `title` available with the value `Products Page`.
+Would render a partial `_product.html.erb` once for each instance of `product` in the `@products` instance variable passing the instance to the partial as a local variable called `item` and to each partial, make the local variable `title` available 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.