<h1>Listing comments</h1>

<table>
  <tr>
    <th>Post</th>
    <th>Author</th>
    <th>Body</th>
  </tr>
  
<% for comment in @comments %>
  <tr>
    <td><%=h comment.post_id %></td>
    <td><%=h comment.author %></td>
    <td><%=h comment.body %></td>
    <td><%= link_to 'Show', object_url(comment) %></td>
    <td><%= link_to 'Edit', edit_object_url(comment) %></td>
    <td><%= link_to 'Destroy', object_url(comment), :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New comment', new_object_url%>