<p id="notice"><%= flash[:notice] %></p>

<%= form_tag search_products_path, method: :get do %>
  <%= label_tag "name", "Search by product name:" %>
  <%= text_field_tag "name" %>
  <%= submit_tag"Search" %>
<% end %>

<h1>Listing Products</h1>

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
      <th>Cost</th>
      <th>Stock</th>
    </tr>
  </thead>
  <tbody>
    <% @products.each do |product| %>
      <tr>
        <td><%= product.name %></td>
        <td><%= product.description %></td>
        <td><%= number_to_currency product.cost, unit: "PhP" %></td>
        <td><%= product.stock %></td>
        <td><%= link_to 'Show', product %></td>
      </tr>
    <% end %>  
  </tbody>
</table>
<p id="notice"><%= flash[:notice] %></p>

<%= form_tag search_products_path, method: :get do %>
  <%= label_tag "name", "Search by product name:" %>
  <%= text_field_tag "name" %>
  <%= submit_tag"Search" %>
<% end %>

<h1>Listing Products</h1>

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
      <th>Cost</th>
      <th>Stock</th>
    </tr>
  </thead>
  <tbody>
    <% @products.each do |product| %>
      <tr>
        <td><%= product.name %></td>
        <td><%= product.description %></td>
        <td><%= number_to_currency product.cost, unit: "PhP" %></td>
        <td><%= product.stock %></td>
        <td><%= link_to 'Show', product %></td>
      </tr>
    <% end %>  
  </tbody>
</table>

<p><%= link_to "Create a new Product", new_product_path %></p>
Add link to New Product
Add link to New Product
