aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gunderloy <MikeG1@larkfarm.com>2008-11-01 07:03:15 -0500
committerMike Gunderloy <MikeG1@larkfarm.com>2008-11-01 07:03:15 -0500
commit82f46da522bcfeec41d3c42f0d9f91191ae1e0d6 (patch)
tree25d94a0c853ba2b58c50546c37b63df3e0c77eb0
parent1d84c158c1aff15149a91b86f44138d96e417134 (diff)
downloadrails-82f46da522bcfeec41d3c42f0d9f91191ae1e0d6.tar.gz
rails-82f46da522bcfeec41d3c42f0d9f91191ae1e0d6.tar.bz2
rails-82f46da522bcfeec41d3c42f0d9f91191ae1e0d6.zip
Add warning about deprecated partials behavior to Layout/Rendering Guide
-rw-r--r--railties/doc/guides/html/layouts_and_rendering.html10
-rw-r--r--railties/doc/guides/source/layouts_and_rendering.txt4
2 files changed, 12 insertions, 2 deletions
diff --git a/railties/doc/guides/html/layouts_and_rendering.html b/railties/doc/guides/html/layouts_and_rendering.html
index 8f78429610..c650a3bc0b 100644
--- a/railties/doc/guides/html/layouts_and_rendering.html
+++ b/railties/doc/guides/html/layouts_and_rendering.html
@@ -1225,7 +1225,7 @@ _form.html.erb:
&lt;% end %&gt;
</tt></pre></div></div>
<div class="para"><p>Although the same partial will be rendered into both views, the label on the submit button is controlled by a local variable passed into the partial.</p></div>
-<div class="para"><p>Every partial also has a local variable with the same name as the partial (minus the underscore). By default, it will look for an instance variable with the same name as the partial in the parent. You can pass an object in to this local variable via the <tt>:object</tt> option:</p></div>
+<div class="para"><p>Every partial also has a local variable with the same name as the partial (minus the underscore). You can pass an object in to this local variable via the <tt>:object</tt> option:</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
by Lorenzo Bettini
@@ -1234,6 +1234,14 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt>&lt;%= render :partial =&gt; "customer", :object =&gt; @new_customer %&gt;
</tt></pre></div></div>
<div class="para"><p>Within the <tt>customer</tt> partial, the <tt>@customer</tt> variable will refer to <tt>@new_customer</tt> from the parent view.</p></div>
+<div class="admonitionblock">
+<table><tr>
+<td class="icon">
+<img src="./images/icons/warning.png" alt="Warning" />
+</td>
+<td class="content">In previous versions of Rails, the default local variable would look for an instance variable with the same name as the partial in the parent. This behavior is deprecated in Rails 2.2 and will be removed in a future version.</td>
+</tr></table>
+</div>
<div class="para"><p>If you have an instance of a model to render into a partial, you can use a shorthand syntax:</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
diff --git a/railties/doc/guides/source/layouts_and_rendering.txt b/railties/doc/guides/source/layouts_and_rendering.txt
index 4211f9a0b5..abf04d084d 100644
--- a/railties/doc/guides/source/layouts_and_rendering.txt
+++ b/railties/doc/guides/source/layouts_and_rendering.txt
@@ -806,7 +806,7 @@ _form.html.erb:
Although the same partial will be rendered into both views, the label on the submit button is controlled by a local variable passed into the partial.
-Every partial also has a local variable with the same name as the partial (minus the underscore). By default, it will look for an instance variable with the same name as the partial in the parent. You can pass an object in to this local variable via the +:object+ option:
+Every partial also has a local variable with the same name as the partial (minus the underscore). You can pass an object in to this local variable via the +:object+ option:
[source, html]
-------------------------------------------------------
@@ -815,6 +815,8 @@ Every partial also has a local variable with the same name as the partial (minus
Within the +customer+ partial, the +@customer+ variable will refer to +@new_customer+ from the parent view.
+WARNING: In previous versions of Rails, the default local variable would look for an instance variable with the same name as the partial in the parent. This behavior is deprecated in Rails 2.2 and will be removed in a future version.
+
If you have an instance of a model to render into a partial, you can use a shorthand syntax:
[source, html]