Hi, I would like to do the following. In a form, an attribute is a belongs_to association, so user selects a drop down list. But I would like user to add his own value if needed. For that I have added a ''Add value...'' as last item. Then with an observer, I am replacing the DDL by remote form (text and button). So, when users adds value, ajax call adds the value in the model, and replace the remote form by the DDL, with the new value. My problem is in the remote form. It seems I cannot add a remote form within a form (helper is not generated at all). What''s wrong here? Is there any other possiblity (adding an observer on the button)? Thank you for your help, JE -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Hi Jean-Etienne, Jean-Etienne Durand wrote:> It seems I cannot add a remote form > within a form (helper is not generated at all).That''s correct. Forms cannot contain other forms. The W3C spec spells it out quite clearly. The solution I''ve used in a situation similar to yours is to use Ajax for all the inputs (rendering a checkbox_tag with an associated observe_field, for example) with an empty form_remote_tag''s submit button for page redirection. It looks and acts like a single form to the user. Potentially puts a heavier burden on you for form-level validation, though, since you''re updating the model incrementally. hth, Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I tried to go for an oberver on a input (type button), but observer_field does not generate any html... This is included in a partial (coming from another observer action) Did I do somehting wrong? -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Jean-Etienne Durand wrote:> I tried to go for an oberver on a input (type button), > but observer_field does not generate any html... This > is included in a partial (coming from another observer > action) Did I do somehting wrong?Hard to tell without seeing your code ;-) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Right :) Just wanted to have a confirmation that having an observe_field in a form is possible. Or may I send you some code by mail? Etienne -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Jean-Etienne Durand wrote:> > Or may I send you some code by mail?My personal experience is that moving problem code over to my sandbox, paring it down to the bare essentials, using irb to investigate the behavior of specific methods, etc., more often than not shows me the problem and how to fix it. If need be, you can send along some code. Best regards, Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---