Guest User

Untitled

a guest
Mar 13th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. i have a simple shopping cart built, with Products and Carts and LineItems (which have a cart_id, product_id, and a quantity). How can I nest the routes such that the routes will be something like, "/carts/:id/products/:id" so a restful DELETE on that url will actually delete the line_item
  2.  
  3. map.resources :products do |product|
  4. product.resources :carts do |cart|
  5. cart.resources :lineitems
  6. end
  7. end
Add Comment
Please, Sign In to add comment