Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<div class="product thumbnail">
<div class="caption">
<span class="text-muted pull-right"><%= @product.pack_size %></span>
<div class="product-name"><%= %></div>
<span class="pull-right">₹
<small class="product-price"><%= @product.price %></small>
<!-- add to cart code begins -->
<%= form_for @conn, "/cart", [as: :cart], fn f -> %>
<%= hidden_input f, :product_id, value: %>
<%= number_input f, :quantity, value: 1 %>
<%= submit "Add to cart" %>
<% end %>
<!-- add to cart code ends -->
<img src="<%= @product.image %>" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment