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/source | |
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/source')
-rw-r--r-- | railties/doc/guides/source/2_3_release_notes.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/doc/guides/source/2_3_release_notes.txt b/railties/doc/guides/source/2_3_release_notes.txt index 035f28bca0..32722bf9e6 100644 --- a/railties/doc/guides/source/2_3_release_notes.txt +++ b/railties/doc/guides/source/2_3_release_notes.txt @@ -228,14 +228,14 @@ Rails now keeps a per-request local cache of requests, cutting down on unnecessa Action View in Rails 2.3 picks up improvements to +render+, more flexible prompts for the date select helpers, and a speedup in asset caching, among other things. -=== Smart Rendering +=== Smart Rendering of Partials 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): [source, ruby] ------------------------------------------------------- -<% render @article %> -<% render @articles %> +render @article # Equivalent of render :partial => 'articles/_article', :object => @article +render @articles # Equivalent of render :partial => 'articles/_article', :collection => @articles ------------------------------------------------------- * More Information: link:http://ryandaigle.com/articles/2008/11/20/what-s-new-in-edge-rails-render-stops-being-high-maintenance[What's New in Edge Rails: render Stops Being High-Maintenance] |