<h1><%= @list.name.capitalize %></h1>
<ul>
  <% @items.each do |item|  %>
    <li><%= item.name %></li>
  <% end %>
</ul>
</br>

<table class="table">
  <thead>
    <th>Item</th>
    <th>Date Purchased</th>
  </thead>
  <tbody>
  <% @list.items.each do |item|  %>
      <tr>
        <td><%= item.name %></td>
        <td><%= localize(item.updated_at, format: :long) %></td>
      </tr>
  <% end %>
  </tbody>
</table>

<hr>

<%= link_to "Add New Item", new_list_item_path(@list) %>

<h1><%= @list.name.capitalize %></h1>
<ul>
  <% @items.each do |item|  %>
    <li><%= item.name %></li>
  <% end %>
</ul>
</br>

<table class="table">
  <thead>
    <th>Item</th>
    <th>Date Purchased</th>
  </thead>
  <tbody>
  <% @list.items.each do |item|  %>
      <tr>
        <td> 
          <%= item.name %>
            <%= form_tag list_item_path(@list, item), method: :patch do %>
              <%= submit_tag "RENAME" %>
            <% end %>
            <%= form_tag list_item_path(@list, item), method: :delete do %>
              <%= submit_tag "DELETE" %>
            <% end %>
        </td>
        <td><%= localize(item.updated_at, format: :long) %></td>
      </tr>
  <% end %>
  </tbody>
</table>

<hr>

<%= link_to "Add New Item", new_list_item_path(@list) %>

Add delete and update to Items
Add delete and update to Items
