From 06a1519a4dc714822bec2312a41950aedba82541 Mon Sep 17 00:00:00 2001 From: Oscar Del Ben Date: Mon, 30 Apr 2012 09:08:32 +0200 Subject: Rewrite adding a second model section of Getting Started Guide --- .../getting_started/app/views/posts/show.html.erb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'guides/code/getting_started/app/views/posts/show.html.erb') 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 %>

-<%= link_to 'Back', :action => :index %> -| <%= link_to 'Edit', :action => :edit, :id => @post.id %> + +

Add a comment:

+<%= form_for([@post, @post.comments.build]) do |f| %> +

+ <%= f.label :commenter %>
+ <%= f.text_field :commenter %> +

+

+ <%= f.label :body %>
+ <%= f.text_area :body %> +

+

+ <%= f.submit %> +

+<% end %> + +<%= link_to 'Edit Post', edit_post_path(@post) %> | +<%= link_to 'Back to Posts', posts_path %> -- cgit v1.2.3