Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<%= form_for @conn, "/cart", [class: "cart-form form-inline", as: :cart], fn f -> %>
<div class="form-group">
<div class="input-group">
<%= hidden_input f, :product_name, value: @product.name %>
<%= hidden_input f, :pack_size, value: @product.pack_size %>
<%= hidden_input f, :product_id, value: @product.id %>
<div class="input-group-addon">Qty</div>
<%= number_input f, :quantity, value: 1, class: "form-control", style: "width: 70px" %>
</div>
<%= error_tag f, :quantity %>
</div>
<%= submit "Add to cart", class: "btn btn-primary pull-right" %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment