Skip to content
This repository
Browse code

Corrected typo in example on rendering collections in partials changi…

…ng @posts to @products to match the example
  • Loading branch information...
commit b29eb89be8b65587fd23bdab9b89281fb7069f3b 1 parent c1bafe0
Michael MacDonald authored fxn committed

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  railties/guides/source/layouts_and_rendering.textile
2  railties/guides/source/layouts_and_rendering.textile
Source Rendered
@@ -1087,7 +1087,7 @@ Partials are very useful in rendering collections. When you pass a collection to
1087 1087
1088 1088 When a partial is called with a pluralized collection, then the individual instances of the partial have access to the member of the collection being rendered via a variable named after the partial. In this case, the partial is +_product+, and within the +_product+ partial, you can refer to +product+ to get the instance that is being rendered.
1089 1089
1090   -In Rails 3.0 there is also a shorthand for this, assuming +@posts+ is a collection of +post+ instances, you can simply do in the +index.html.erb+:
  1090 +In Rails 3.0 there is also a shorthand for this, assuming +@products+ is a collection of +product+ instances, you can simply do in the +index.html.erb+:
1091 1091
1092 1092 <erb>
1093 1093 <h1>Products</h1>

0 comments on commit b29eb89

Please sign in to comment.
Something went wrong with that request. Please try again.