diff options
author | Oscar Del Ben <info@oscardelben.com> | 2012-05-02 10:42:59 +0200 |
---|---|---|
committer | Oscar Del Ben <info@oscardelben.com> | 2012-05-02 11:40:25 +0200 |
commit | 47ec49276d40ed565d805069bb2a746e9a7b3157 (patch) | |
tree | c248cfffe23a2156f471178a9fb69730e9f9238f /guides/code/getting_started | |
parent | a411e8828a50795139df6ed210271c1a6cbd135d (diff) | |
download | rails-47ec49276d40ed565d805069bb2a746e9a7b3157.tar.gz rails-47ec49276d40ed565d805069bb2a746e9a7b3157.tar.bz2 rails-47ec49276d40ed565d805069bb2a746e9a7b3157.zip |
Rewrite comments action in getting started guide
Diffstat (limited to 'guides/code/getting_started')
-rw-r--r-- | guides/code/getting_started/app/views/posts/show.html.erb | 12 |
1 files changed, 12 insertions, 0 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 0580879c1a..7066c85065 100644 --- a/guides/code/getting_started/app/views/posts/show.html.erb +++ b/guides/code/getting_started/app/views/posts/show.html.erb @@ -8,6 +8,18 @@ <%= @post.text %> </p> +<h2>Comments</h2> +<% @post.comments.each do |comment| %> + <p> + <strong>Commenter:</strong> + <%= comment.commenter %> + </p> + + <p> + <strong>Comment:</strong> + <%= comment.body %> + </p> +<% end %> <h2>Add a comment:</h2> <%= form_for([@post, @post.comments.build]) do |f| %> |