1234567891011121314151617181920212223242526272829 |
- <h1>Listing line_items</h1>
- <table>
- <thead>
- <tr>
- <th>Product</th>
- <th>Cart</th>
- <th></th>
- <th></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @line_items.each do |line_item| %>
- <tr>
- <td><%= line_item.product %></td>
- <td><%= line_item.cart %></td>
- <td><%= link_to 'Show', line_item %></td>
- <td><%= link_to 'Edit', edit_line_item_path(line_item) %></td>
- <td><%= link_to 'Destroy', line_item, method: :delete, data: { confirm: 'Are you sure?' } %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- <br>
- <%= link_to 'New Line item', new_line_item_path %>
|