daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top