diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-01-30 19:16:07 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-01-30 19:28:23 +0000 |
commit | 130b96a9af91fada7f1203545557c26b9d0088c6 (patch) | |
tree | ce06864a67258384094f4d25c9130808da2eb0e2 /railties/doc/guides/html | |
parent | 807f5f1fd2fb72ba8d29abb49e943e05b0c9e03d (diff) | |
download | rails-130b96a9af91fada7f1203545557c26b9d0088c6.tar.gz rails-130b96a9af91fada7f1203545557c26b9d0088c6.tar.bz2 rails-130b96a9af91fada7f1203545557c26b9d0088c6.zip |
Make Partial example more clear
Diffstat (limited to 'railties/doc/guides/html')
-rw-r--r-- | railties/doc/guides/html/2_3_release_notes.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/railties/doc/guides/html/2_3_release_notes.html b/railties/doc/guides/html/2_3_release_notes.html index 29157d0154..63fe1e78ea 100644 --- a/railties/doc/guides/html/2_3_release_notes.html +++ b/railties/doc/guides/html/2_3_release_notes.html @@ -89,7 +89,7 @@ <a href="#_action_view">Action View</a> <ul> - <li><a href="#_smart_rendering">Smart Rendering</a></li> + <li><a href="#_smart_rendering_of_partials">Smart Rendering of Partials</a></li> <li><a href="#_prompts_for_date_select_helpers">Prompts for Date Select Helpers</a></li> @@ -553,15 +553,15 @@ You can now use symbols for the <tt>:type</tt> option of <tt>send_file</tt> and <h2 id="_action_view">5. Action View</h2>
<div class="sectionbody">
<div class="paragraph"><p>Action View in Rails 2.3 picks up improvements to <tt>render</tt>, more flexible prompts for the date select helpers, and a speedup in asset caching, among other things.</p></div>
-<h3 id="_smart_rendering">5.1. Smart Rendering</h3>
+<h3 id="_smart_rendering_of_partials">5.1. Smart Rendering of Partials</h3> <div class="paragraph"><p>The render method has been getting smarter over the years, and it’s even smarter now. If you have an object or a collection and an appropriate partial, and the naming matches up, you can now just render the object and things will work. For example, in Rails 2.3, these render calls will work in your view (assuming sensible naming):</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 2.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #FF0000"><% render @article %></span>
-<span style="color: #FF0000"><% render @articles %></span></tt></pre></div></div>
+<pre><tt>render <span style="color: #009900">@article</span> <span style="font-style: italic"><span style="color: #9A1900"># Equivalent of render :partial => 'articles/_article', :object => @article</span></span> +render <span style="color: #009900">@articles</span> <span style="font-style: italic"><span style="color: #9A1900"># Equivalent of render :partial => 'articles/_article', :collection => @articles</span></span></tt></pre></div></div> <div class="ulist"><ul>
<li>
<p>
|