aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/layouts_and_rendering.textile
diff options
context:
space:
mode:
authorRafaël Blais Masson <rafbmasson@gmail.com>2012-03-31 10:31:43 -0400
committerRafaël Blais Masson <rafbmasson@gmail.com>2012-03-31 10:31:43 -0400
commitbf8c3eb55ac037afc63875a2d78ad0799f56a3cc (patch)
tree6ffa04f21c1b67c0ea5ea1a3a3b710a4ff06566b /guides/source/layouts_and_rendering.textile
parent03c051eb54c5042177ca75a7b2534c1a5cd513e1 (diff)
downloadrails-bf8c3eb55ac037afc63875a2d78ad0799f56a3cc.tar.gz
rails-bf8c3eb55ac037afc63875a2d78ad0799f56a3cc.tar.bz2
rails-bf8c3eb55ac037afc63875a2d78ad0799f56a3cc.zip
Reorder bits in the Layouts and Rendering guide
Diffstat (limited to 'guides/source/layouts_and_rendering.textile')
-rw-r--r--guides/source/layouts_and_rendering.textile14
1 files changed, 7 insertions, 7 deletions
diff --git a/guides/source/layouts_and_rendering.textile b/guides/source/layouts_and_rendering.textile
index 4b4f9f3745..7c7fc7044c 100644
--- a/guides/source/layouts_and_rendering.textile
+++ b/guides/source/layouts_and_rendering.textile
@@ -1134,13 +1134,6 @@ In Rails 3.0, there is also a shorthand for this. Assuming +@products+ is a coll
Rails determines the name of the partial to use by looking at the model name in the collection. In fact, you can even create a heterogeneous collection and render it this way, and Rails will choose the proper partial for each member of the collection:
-In the event that the collection is empty, +render+ will return nil, so it should be fairly simple to provide alternative content.
-
-<erb>
-<h1>Products</h1>
-<%= render(@products) || 'There are no products available.' %>
-</erb>
-
* +index.html.erb+
<erb>
@@ -1162,6 +1155,13 @@ In the event that the collection is empty, +render+ will return nil, so it shoul
In this case, Rails will use the customer or employee partials as appropriate for each member of the collection.
+In the event that the collection is empty, +render+ will return nil, so it should be fairly simple to provide alternative content.
+
+<erb>
+<h1>Products</h1>
+<%= render(@products) || 'There are no products available.' %>
+</erb>
+
h5. Local Variables
To use a custom local variable name within the partial, specify the +:as+ option in the call to the partial: