diff options
author | James Miller <bensie@gmail.com> | 2010-08-26 12:10:21 -0700 |
---|---|---|
committer | James Miller <bensie@gmail.com> | 2010-08-26 12:10:21 -0700 |
commit | 2bcac56ab4059356f9f1a0f0d970fd3c9d225f65 (patch) | |
tree | e228437ab7828a8ce27280afe0573b735df89bde /railties | |
parent | a88fb2fd1b2521c3bed02d97805ae7a83eb975df (diff) | |
download | rails-2bcac56ab4059356f9f1a0f0d970fd3c9d225f65.tar.gz rails-2bcac56ab4059356f9f1a0f0d970fd3c9d225f65.tar.bz2 rails-2bcac56ab4059356f9f1a0f0d970fd3c9d225f65.zip |
Prefer modern idiom for rendering partials on a collection
Diffstat (limited to 'railties')
-rw-r--r-- | railties/guides/source/getting_started.textile | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index dc60377e34..48393d2156 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -1056,8 +1056,7 @@ Then in the +app/views/posts/show.html.erb+ you can change it to look like the f </p> <h2>Comments</h2> -<%= render :partial => "comments/comment", - :collection => @post.comments %> +<%= render @post.comments %> <h2>Add a comment:</h2> <%= form_for([@post, @post.comments.build]) do |f| %> @@ -1127,8 +1126,7 @@ Then you make the +app/views/posts/show.html.erb+ look like the following: </p> <h2>Comments</h2> -<%= render :partial => "comments/comment", - :collection => @post.comments %> +<%= render @post.comments %> <h2>Add a comment:</h2> <%= render "comments/form" %> @@ -1381,8 +1379,7 @@ Finally, we will edit the <tt>app/views/posts/show.html.erb</tt> template to sho </p> <h2>Comments</h2> -<%= render :partial => "comments/comment", - :collection => @post.comments %> +<%= render @post.comments %> <h2>Add a comment:</h2> <%= render "comments/form" %> @@ -1436,8 +1433,7 @@ Now you can edit the view in <tt>app/views/posts/show.html.erb</tt> to look like </p> <h2>Comments</h2> -<%= render :partial => "comments/comment", - :collection => @post.comments %> +<%= render @post.comments %> <h2>Add a comment:</h2> <%= render "comments/form" %> |