Craig Demyanovich wrote: > In their example, > ... [snip] > they assign the product to the details, @details.product = @product. > When > you do that with related ActiveRecord objects, ActiveRecord takes care > of > setting the IDs for you. In this case, @details.product_id will be set > to @ > product.id. > > Regards, > Craig
Thanks for your post Craig. I could not wrap my head around this concept, partially because it was so difficult for me to implement in JSP that I resorted to using randomly generated UUID's before inputing the record into the database. Active Record to the rescue indeed. Wow. I spent about an hour playing with this last night and was able to magically get this to, well, just work in Rails. When I wrote this post originally I hadn't yet tried the example as I just couldn't understand the code and how it worked. I took the leap of faith and followed the example and Ta-da, onto more interesting problems. I should also not that another user wrote me off-list and I'd like to thank him/her for the wonderfully helpful response. I am not mentioning his/her name in the event that they wrote off list because they wanted to remain anonymous. But thank you. They suggested I read: http://railsguides.phusion.nl/activerecord/association_basics.html and it helped immensely. I felt like I missed a meeting! Ruby/Rails has been such a fun experiment thus far. I'm really loving it's elegance and simplicity. Thanks again to all. TTFN. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

