Very new to rails and while following the book: Beginning Ruby on
Rails E-Commerce", I’m trying ti implement a cart, but the cart
doesn’t appear on the html page at all. The code for the cart in app/
<% if @cart %>
If I take out the if @cart, I get this error:
You have a nil object when you didn’t expect it!
The error occurred while evaluating nil.cart_items
Extracted source (around line #7):
Your Shopping Cart
9: <%= render :partial => “cart/item”, :object => item %>
7: <% for item in @cart.cart_items %>
This code appears on app/views/cart/_cart.rhtml
Please help. Anyone?