<h1>Listing categories</h1>

<table>
  <tr>
    <th>Parent</th>
    <th>Name</th>
  </tr>

<% for category in @categories %>
  <tr>
    <td><%=h category.parent_id %></td>
    <td><%=h category.name %></td>
    <td><%= link_to 'Show', category %></td>
    <td><%= link_to 'Edit', edit_category_path(category) %></td>
    <td><%= link_to 'Destroy', category, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New category', new_category_path %>
