24 Oct 2013, 21:43
Generic-user-small

AC Motanya (2 posts)

undefined method `+’ for nil:NilClass

def add_product(product_id) current_item = line_items.find_by(product_id: product_id) if current_item current_item.quantity += 1 else current_item = line_items.build(product_id: product_id) end current_item end

something is wrong with this add method. Nothing I can do will make the line items add up in the cart.

24 Oct 2013, 21:59
Generic-user-small

AC Motanya (2 posts)

No one was going to answer this anyway, but just in case.. I figured it out.

  You must be logged in to comment