"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!
14 days later - Figured out the answer. Hopefully my next question will get some response. The trick was.
14 days later - Figured out the answer. Hopefully my next question will get some response. The trick was: @topic.linkers.build.
Build_article That builds the linkers, then builds the article for each linker. So, in the models: topic. Rb needs accepts_nested_attributes_for :linkers linker.
Rb needs accepts_nested_attributes_for :articles Then in the form: ...fields... ...linker fields... ...article fields...
4 Let me know if this was helpful – Arcolye Feb 17 '10 at 7:17 4 Rails 3 update: the form_for and field_for need instead of if you're using Rails 3. – Arcolye Sep 29 '10 at 16:09 I would add code backticks around the two accepts_nested_attributes_for lines you added. I missed that info repeatedly while just scanning the code -- once I read it thoroughly, I caught that missed detail and it solved my problem.
Thanks! – T.J. Schuck Jan 24 at 16:31.
I was just looking to do the same sort of thing! I've got two models: Songs and Performances and they are joined by PlayedSongs. But I've got additional fields besides song_id and performance_id on the PlayedSongs.
One of which is "play_order" because the songs need to be displayed in the order they were played live (I'm working on a site to catalog live performances) and I couldn't figure out how to do it automagically...somehow having Rails auto-fill the played_order field with a loop starting at 1 and adding 1 for each additional song added to the performance. This is a big help (I hope) toward making it a bit easier...right now I've got a separate action setup with a separate view that users must go to and manually enter the play_order after adding the songs to the show...this might allow me to bring that up one level and have it right on the page when they're first adding the songs. I know this isn't helping you at all and for that I apologize, I just wanted to thank you for posting this after you figured it out.
I have a question though. Did this: @topic.linkers.build. Build_article Replace @topic.articles.
Build In your New action then? Or are both lines still needed? And are you calling both accepts_nested_attributes_for :article accepts_nested_attributes_for :linker on the topic model?
Or just the line for :linker? If just :linker, is it because Rails is smart enough to know that Articles are tied to Linkers with the HMT relationship and therefore grants you access to that model as well?
I just edited my answer to answer your question about accepts_nested_attributes_for. And, @topic.linkers.build. Build_article replaces @topic.articles.
Build – Arcolye Mar 6 '10 at 2:23 So sorry it took so long to get back to you. Thank you for your help and for updating your code to reflect the answer to my question! Much appreciated :D – klyrish May 17 '10 at 0:12.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.