Open tacoplz opened 9 years ago
Okay, I think I have a start on the routes, I added the following:
post 'shopping_carts/:shopping_cart_id' => 'shopping_carts#show'
however, now I get an error:
Started POST "/shopping_carts/3" for 162.239.93.178 at 2015-07-07 03:22:28 +0000
Processing by ShoppingCartsController#show as HTML
Parameters: {"authenticity_token"=>"Y5qQZLfyuTEVEBfbbq4xYrMyvF8A3wyrCnFvQOZvehAGSU+IvWjOjJxXVGSO4iPCdVOJyGCk8KsAyzwBfON3TQ==", "shopping_cart_id"=>"3"}
ShoppingCart Load (0.2ms) SELECT "shopping_carts".* FROM "shopping_carts" WHERE "shopping_carts"."id" = ? LIMIT 1 [["id", 1]]
Completed 404 Not Found in 8ms
ActiveRecord::RecordNotFound (Couldn't find ShoppingCart with 'id'=1):
app/controllers/shopping_carts_controller.rb:17:in `extract_shopping_cart'
I think this error has come about due to the ShoppingCart Load query's shopping_carts "id" defaulting to 1. Any suggestions?
im also having the same error. the url is looking like http://localhost:3001/shopping_cart.1 instead of http://localhost:3001/shopping_cart/1
Has someone solved it?
Below is the log. I think the problem is the routes. Ive tried adding a post route to the routes file to no avail. Any help would be very much appreciated. I can provide more information if necessary. Thanks in advance!