<h1>Product</h1>

<table class='table'>
  <thead>
    <th>Name</th>
    <th>Category</th>
    <th>Brand</th>
    
    <th colspan=3>Actions</th>
  </thead>
  <tbody>
    <% @products.each do |product| %>
      <tr>
        <td><%= product.name %></td>
        <td><%= product.category_id %></td>
        <td><%= product.brand_id %></td>
      
        <td><%= link_to "Show", product_path(product) %></td>
        <td><%= link_to "Edit", edit_product_path(product) %></td>
        <td>
          <%= link_to "Delete", product_path(product),
            "data-turbo-method": :delete,
            "data-turbo-confirm": "Are you sure?" %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to "New product", new_product_path %>