Guest User

Untitled

a guest
Jul 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. <% if item.comments.empty? %>
  2. No comments to display.
  3. <% else %>
  4. <% for comment in item.comments %>
  5. <p><%= comment.created_at %> <%= link_to "Destroy", [item, Comment], :confirm => 'Are you sure?', :method => :destroy %></p>
  6. <p><%= comment.body %></p>
  7. <% end %>
  8. <% end %>
  9. Add Comment
  10. <% form_for [item, Comment.new()] do |f| %>
  11. <%= f.text_area :body %><br />
  12. <%= f.submit %>
  13. <% end %>
Add Comment
Please, Sign In to add comment