Ruby on Rails
Tuesday, February 28, 2012
So this whole many-to-many thing has me really confused. I get how to set it up but I can't seem to find anywhere that really explains the best way to use it in your controller.
What I have:
Products, Orders, Orders_Products
The Products and Orders table has the standard stuff (Id, name, timestamps, etc)
The Orders_Products table has the two id columns (order_id, product_id) and a quantity column.
What I need to do:
Now when I save my "cart" how do you save a new order and each product with its quantity?
This is my first app in rails so the more explanation the better.
Thanks in advance for all the help!
--You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/NZFLIYGhDL8J.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment