/product_card.html.eex Secret
Created
July 8, 2017 10:26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="product thumbnail"> | |
<div class="caption"> | |
<span class="text-muted pull-right"><%= @product.pack_size %></span> | |
<h2> | |
<div class="product-name"><%= @product.name %></div> | |
<span class="pull-right">₹ | |
<small class="product-price"><%= @product.price %></small> | |
</span> | |
</h2> | |
<hr/> | |
<!-- add to cart code begins --> | |
<%= form_for @conn, "/cart", [as: :cart], fn f -> %> | |
<%= hidden_input f, :product_id, value: @product.id %> | |
<%= number_input f, :quantity, value: 1 %> | |
<%= submit "Add to cart" %> | |
<% end %> | |
<!-- add to cart code ends --> | |
</div> | |
<img src="<%= @product.image %>" /> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment