diff options
Diffstat (limited to 'railties/guides/code/getting_started/app/views/comments')
-rw-r--r-- | railties/guides/code/getting_started/app/views/comments/_comment.html.erb | 15 | ||||
-rw-r--r-- | railties/guides/code/getting_started/app/views/comments/_form.html.erb | 13 |
2 files changed, 28 insertions, 0 deletions
diff --git a/railties/guides/code/getting_started/app/views/comments/_comment.html.erb b/railties/guides/code/getting_started/app/views/comments/_comment.html.erb new file mode 100644 index 0000000000..4c3fbf26cd --- /dev/null +++ b/railties/guides/code/getting_started/app/views/comments/_comment.html.erb @@ -0,0 +1,15 @@ +<p> + <b>Commenter:</b> + <%= comment.commenter %> +</p> + +<p> + <b>Comment:</b> + <%= comment.body %> +</p> + +<p> + <%= link_to 'Destroy Comment', [comment.post, comment], + :confirm => 'Are you sure?', + :method => :delete %> +</p> diff --git a/railties/guides/code/getting_started/app/views/comments/_form.html.erb b/railties/guides/code/getting_started/app/views/comments/_form.html.erb new file mode 100644 index 0000000000..d15bdd6b59 --- /dev/null +++ b/railties/guides/code/getting_started/app/views/comments/_form.html.erb @@ -0,0 +1,13 @@ +<%= form_for([@post, @post.comments.build]) do |f| %> + <div class="field"> + <%= f.label :commenter %><br /> + <%= f.text_field :commenter %> + </div> + <div class="field"> + <%= f.label :body %><br /> + <%= f.text_area :body %> + </div> + <div class="actions"> + <%= f.submit %> + </div> +<% end %> |