rails g migration add_quantity_to_line_items quantity:integer
set the default of quantity
rake db:migrate
add add_product method in Cart

It will check whether our list of items already includes the product we’re adding;if it does, it bumps the quantity, and if it doesn’t, it builds a new LineItem
use add_product method in line_items controller
update the show page of cart
rails g migration combine_items_in_cart
replace the up method to combine items in cart
rake db:migrate
replace the down method to split items with quantity>1 into multiple items
redirect to store_url when Invalid cart
remove cart_id from the list of parameters that are permitted
fix the error add_product method in cart model
remove cart_id from test case
add button to empty cart
update the destroy method in carts controller
update the destroy test in carts controller test
remove the flash message when a line item is added
update the show page for carts
add total_price method for line_items