diff options
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 | 45 |
1 files changed, 21 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 da78a9527b..0580879c1a 100644 --- a/guides/code/getting_started/app/views/posts/show.html.erb +++ b/guides/code/getting_started/app/views/posts/show.html.erb @@ -1,31 +1,28 @@ -<p class="notice"><%= notice %></p> - <p> - <b>Name:</b> - <%= @post.name %> -</p> - -<p> - <b>Title:</b> + <strong>Title:</strong> <%= @post.title %> </p> - -<p> - <b>Content:</b> - <%= @post.content %> -</p> - + <p> - <b>Tags:</b> - <%= join_tags(@post) %> + <strong>Text:</strong> + <%= @post.text %> </p> - -<h2>Comments</h2> -<%= render @post.comments %> - + + <h2>Add a comment:</h2> -<%= render "comments/form" %> - - +<%= 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 %> | +<%= link_to 'Back to Posts', posts_path %> |