forked from turingschool-projects/little_shop_v2
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from tnodland/cart_quantities
Cart Quantities User Story 24/5
- Loading branch information
Showing
7 changed files
with
139 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
<div id=<%="cart-item-#{item.id}"%>> | ||
<div id=item-name><%=item.name%></div> | ||
<div id=item-name>Item Name: <%=item.name%></div> | ||
<div id=item-merchant><%=item.user.name%></div> | ||
<div id=item-price><%=item.current_price%></div> | ||
<div id=item-quantity><%=quantity%></div> | ||
<div id=subtotal><%=quantity*item.current_price%></div> | ||
<img src=<%=item.image_url%> height=20px width=20px/> | ||
<div id=item-quantity> | ||
<%= form_tag cart_path(item_id: item.id), method: :patch do %> | ||
<%= select_tag "quantity", options_for_select((0..item.quantity).to_a, selected: quantity) %> | ||
<%= submit_tag "Update Quantity"%> | ||
<%end%> | ||
<%= button_to "Remove Item", cart_path(item_id: item.id, quantity:0), method: :patch %> | ||
</div> | ||
<div id=subtotal><%=(quantity*item.current_price).round(2)%></div> | ||
|
||
</div> |
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
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
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
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