aboutsummaryrefslogtreecommitdiffstats
path: root/guides/code/getting_started/app/views/posts/show.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'guides/code/getting_started/app/views/posts/show.html.erb')
-rw-r--r--guides/code/getting_started/app/views/posts/show.html.erb20
1 files changed, 18 insertions, 2 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 aea28cd5a2..0580879c1a 100644
--- a/guides/code/getting_started/app/views/posts/show.html.erb
+++ b/guides/code/getting_started/app/views/posts/show.html.erb
@@ -8,5 +8,21 @@
<%= @post.text %>
</p>
-<%= link_to 'Back', :action => :index %>
-| <%= link_to 'Edit', :action => :edit, :id => @post.id %>
+
+<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 %>
+
+<%= link_to 'Edit Post', edit_post_path(@post) %> |
+<%= link_to 'Back to Posts', posts_path %>