diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-05-01 19:06:03 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-05-01 19:06:03 +0530 |
commit | 42ff22f33a8963f1a1352f98e83b9918aa1a160d (patch) | |
tree | 3f43a8acee3ab20de78c4c9e30792296fddd06e4 /guides/code/getting_started/app/views/posts/show.html.erb | |
parent | 3cc6995e714bc763b40eb3e1d710c1e5ded44384 (diff) | |
parent | 339602b219e1fd842599f6750eb965f327a995c4 (diff) | |
download | rails-42ff22f33a8963f1a1352f98e83b9918aa1a160d.tar.gz rails-42ff22f33a8963f1a1352f98e83b9918aa1a160d.tar.bz2 rails-42ff22f33a8963f1a1352f98e83b9918aa1a160d.zip |
Merge branch 'master' of github.com:lifo/docrails
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.erb | 20 |
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 %> |