small medium large xlarge

03 Jun 2013, 07:20
Roger McDonald (8 posts)

undefined method `line_items’ for nil:NilClass

I create my selection, Go to Cart and confirm details, Click Checkout and get error: def add_line_items_from_cart(cart) cart.line_items.each do |item| item.cart_id = nil line_items << item end

—–if I delete

@order.add_line_items_from_cart(@cart) error goes away?

10 Nov 2013, 01:41
Tony Kyle (6 posts)

I too am experiencing this issue in the same location. This also happens with code from the book downloaded from PragProg.

10 Nov 2013, 22:00
Tony Kyle (6 posts)

Mine got resolved with Chapter 12 code.

You must be logged in to comment