I’ve also made a start on the Agile Web Dev using Rails book! I’ve been
hit with a problem when hitting the ‘Add to Cart’ button - I get the
following error message:
ActiveRecord::RecordNotFound in StoreController#add_to_cart
Couldn’t find Product without an ID
Application Trace | Framework Trace | Full Trace
It seems to me that the id of the item is not been passed in - my
storecontroller code looks like this:
add a product to the cart
@cart = find_cart @product = Product.find(params[:id]) @cart.add_product(@product)
It’s not obvious to me where the id is supposed to be set / got from?
Can anybody help?