Hi, I am new to Ruby. I want to develop one page with multiple child records associated with master record. So basic idea is to have one contact dropdown and add multiple contacts in session. After saving contact is session, display added contact records in the same page with remove link. Up to this data is managed in session only. After click on final save button, master record will be saved and all the contact records of session also needs to be saved. Can anyone guide me how to develop this kind of scenario. Thanks in advance. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 9, 12:40 pm, Kunjan Batavia <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > I am new to Ruby. > I want to develop one page with multiple child records associated with > master record. >Have you searched some the examples that use accepts_nested_attributes_for ? A lot of tutorials/examples on it cover the ability to add/edit multiple child records is Fred> So basic idea is to have one contact dropdown and add multiple contacts > in session. > > After saving contact is session, display added contact records in the > same page with remove link. Up to this data is managed in session only. > > After click on final save button, master record will be saved and all > the contact records of session also needs to be saved. > > Can anyone guide me how to develop this kind of scenario. > > Thanks in advance. > > -- > Posted viahttp://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
On Wed, Feb 9, 2011 at 6:10 PM, Kunjan Batavia <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > I am new to Ruby. > I want to develop one page with multiple child records associated with > master record. > > So basic idea is to have one contact dropdown and add multiple contacts > in session. > > After saving contact is session, display added contact records in the > same page with remove link. Up to this data is managed in session only. > > After click on final save button, master record will be saved and all > the contact records of session also needs to be saved. > > Can anyone guide me how to develop this kind of scenario. > > Try accepts_nested_attributes_for.Apart from this, why do you want to use sessions for this. The way I am looking at your application, you are actually saving the user''s preferences/ changes in the session for some time and then doing a DB update when the user clicks on Save button. Why not store the user preferences in a javascript object. I might be mistaken, but in my opinion I would never go for storing something in sessions, because unless you are encrypting them, they are vulnerable and there are many issues involved. Correct me if I am wrong.> Thanks in advance. > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.