I'm following a tutorial with a public controller, line_item model,
and cart model. When I try to add an item to the cart I am getting an
NoMethodError in PublicController#add_to_cart
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.<<
On the face of it this doesn't make sense - the only thing you call <<
on is @items and that is initialized to  in the Cart's initialize
method. My guess would be that this was missing in your first attempt
and although you have now fixed this, the session still contains a bad
object with nil @items. Restarting the browser would fix it if this
was the problem (as well as outlining one of the pitfalls with storing
complex objects in the session).