Greetings, I am curious to see if anyone can suggest an efficient approach to a problem I am having with nested AJAX forms which I am trying to avoid. For example, let''s say we have 3 models: 1. Problem (has_many :questions) 2. Question (belongs_to :problem, has_many :answers) 3. Answer (belongs_to :question) I have a form that allows a user to document a problem. Also, the user is able to pose 0..n questions for the documented problem and then 0..n possible answers for each question posed. I was using a form_remote_tag to add questions on the problem form page by using the form_remote_tag to call a method that returns another ajax form (form_remote_tag) to do add any possible answers to the question. I know, I know nested forms-ugh. The returned answers are showing up in the wrong DOM elements; I''m pretty sure I can develop a workaround, but I am getting this feeling that I used to when using Java and JSPs and AJAX where code starts getting real convoluted. I am sure there are some Rails hackers out there that can suggest a cleaner, more Railesque way. Form.serialize perhaps? Thanks-David The question I have for the community is how you, in general, would approach such a problem. Would you use AJAX type forms to keep a user on one page or would you split it up. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> The question I have for the community is how you, in general, would > approach such a problem. Would you use AJAX type forms to keep a user > on one page or would you split it up.3 Options 1) Dont use nested forms, because - quite simply - they dont work. (easiest) 2) Use link_to_remote :with (wont support multipart) 3) Use modal windows ala lightbox. (looks pretty) --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Matt, I have kind of reached conclusion 1. I''ll peek at a lightbox approach and maybe even an IFRAME. Thanks again-David On Jun 11, 2:46 pm, Matt <m...-5JC3FsxXPsVpLGFMi4vTTA@public.gmane.org> wrote:> > The question I have for the community is how you, in general, would > > approach such a problem. Would you use AJAX type forms to keep a user > > on one page or would you split it up. > > 3 Options > > 1) Dont use nested forms, because - quite simply - they dont work. > (easiest) > 2) Use link_to_remote :with (wont support multipart) > 3) Use modal windows ala lightbox. (looks pretty)--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---