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 | 28 |
1 files changed, 28 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 new file mode 100644 index 0000000000..0580879c1a --- /dev/null +++ b/guides/code/getting_started/app/views/posts/show.html.erb @@ -0,0 +1,28 @@ +<p> + <strong>Title:</strong> + <%= @post.title %> +</p> + +<p> + <strong>Text:</strong> + <%= @post.text %> +</p> + + +<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 %> |