aboutsummaryrefslogtreecommitdiffstats
path: root/guides/code/getting_started/app/views/posts
diff options
context:
space:
mode:
authorOscar Del Ben <info@oscardelben.com>2012-05-02 11:13:20 +0200
committerOscar Del Ben <info@oscardelben.com>2012-05-02 11:40:25 +0200
commit323d2c42c3782db9e30b37abb4787fe73d6d7c8d (patch)
tree4065a2e37b588ada7c6cfb20d346f856a78a1d59 /guides/code/getting_started/app/views/posts
parent47ec49276d40ed565d805069bb2a746e9a7b3157 (diff)
downloadrails-323d2c42c3782db9e30b37abb4787fe73d6d7c8d.tar.gz
rails-323d2c42c3782db9e30b37abb4787fe73d6d7c8d.tar.bz2
rails-323d2c42c3782db9e30b37abb4787fe73d6d7c8d.zip
Rewrite refactoring section in getting started guide
Diffstat (limited to 'guides/code/getting_started/app/views/posts')
-rw-r--r--guides/code/getting_started/app/views/posts/show.html.erb26
1 files changed, 2 insertions, 24 deletions
diff --git a/guides/code/getting_started/app/views/posts/show.html.erb b/guides/code/getting_started/app/views/posts/show.html.erb
index 7066c85065..65809033ed 100644
--- a/guides/code/getting_started/app/views/posts/show.html.erb
+++ b/guides/code/getting_started/app/views/posts/show.html.erb
@@ -9,32 +9,10 @@
</p>
<h2>Comments</h2>
-<% @post.comments.each do |comment| %>
- <p>
- <strong>Commenter:</strong>
- <%= comment.commenter %>
- </p>
-
- <p>
- <strong>Comment:</strong>
- <%= comment.body %>
- </p>
-<% end %>
+<%= render @post.comments %>
<h2>Add a comment:</h2>
-<%= form_for([@post, @post.comments.build]) do |f| %>
- <p>
- <%= f.label :commenter %><br />
- <%= f.text_field :commenter %>
- </p>
- <p>
- <%= f.label :body %><br />
- <%= f.text_area :body %>
- </p>
- <p>
- <%= f.submit %>
- </p>
-<% end %>
+<%= render "comments/form" %>
<%= link_to 'Edit Post', edit_post_path(@post) %> |
<%= link_to 'Back to Posts', posts_path %>