You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

25 lines
907 B

<% content_for :title, "Products" %>
<div class="w-full">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block" id="notice"><%= notice %></p>
<% end %>
<div class="flex justify-between items-center">
<h1 class="font-bold text-4xl">Products</h1>
<%= link_to "New product", new_product_path, class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white block font-medium" %>
</div>
<div id="products" class="min-w-full">
<% if @products.any? %>
<% @products.each do |product| %>
<%= render product %>
<p>
<%= link_to "Show this product", product, class: "ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
</p>
<% end %>
<% else %>
<p class="text-center my-10">No products found.</p>
<% end %>
</div>
</div>