kristindiannefoss / little_shop

1 stars 0 forks source link

cart_items_controller #46

Closed kristindiannefoss closed 8 years ago

kristindiannefoss commented 8 years ago

refactor: @cart.contents[params["item_id"]] = params["session"]["quantity"].to_i

@cart.remove_items

in cart.rb: instead of total price just do items.reduce(0) { | sum, item | sum + item.subtotal}

can get rid of sub total inside of cart