Asset-Tracker/app/views/comments/index.html.erb

24 lines
546 B
Plaintext
Raw Normal View History

2011-06-15 01:08:28 +00:00
<h1>Listing comments</h1>
<table>
<tr>
<th>Post</th>
<th>Commenter</th>
<th>Body</th>
</tr>
<% @comments.each do |comment| %>
<tr>
<td><%=h comment.post_id %></td>
<td><%=h comment.commenter %></td>
<td><%=h comment.body %></td>
<td><%= link_to 'Show', comment %></td>
<td><%= link_to 'Edit', edit_comment_path(comment) %></td>
<td><%= link_to 'Destroy', comment, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New comment', new_comment_path %>