Can anyone help me with this form observer? I have a form in my page <%= " <form id=''notes_#{id}''> <input type=''text'' id=''monday_#{id}'' name=''monday'' value=''''><br> ..... <input type=''text'' id=''sunday_#{id}'' name=''sunday'' value=''''><br> </form> " %> Followed by the observer <%= observe_form "notes_#{id}", :frequency => 2.5, :url => {:controller=> ''ajax_test'', :action => ''saveNote''} %> In the controller its simply def saveNote @a = params end and in saveNote.rjs page.alert debug(@a) when it saves the alert is alert("<pre class=''debug_dump''>--- !map:HashWithIndifferentAccess \naction: saveNotes\ncontroller: ajax\n</pre>"); I had hoped to see something like monday_id = ... tuesday_id = ... and so on. Does anyone know why the data isn''t being sent? -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Fred, Fred wrote:> > Can anyone help me with this form observer? > > I have a form in my page > <%= " > <form id=''notes_#{id}''> > <input type=''text'' id=''monday_#{id}'' name=''monday'' value=''''><br> > ..... > <input type=''text'' id=''sunday_#{id}'' name=''sunday'' value=''''><br> > </form> > " %>I''m pretty sure that by hard-coding your html here, you''re not letting Rails know what it needs to know to generate the code you need from the observe_form method. I''d recommend you consult the form_tag, text_field, etc. methods at api.rubyonrails.org. Also, a scaffolded app in yousandbox would probably provide some good stuff to get your arms around how things work. hth, Bill hth, Bill> > Followed by the observer > <%= observe_form "notes_#{id}", :frequency => 2.5, > :url => {:controller=> ''ajax_test'', :action => ''saveNote''} %> > > In the controller its simply > def saveNote > @a = params > end > > and in saveNote.rjs > page.alert debug(@a) > > > when it saves the alert is > alert("<pre class=''debug_dump''>--- !map:HashWithIndifferentAccess > \naction: saveNotes\ncontroller: ajax\n</pre>"); > > I had hoped to see something like > monday_id = ... > tuesday_id = ... > and so on. Does anyone know why the data isn''t being sent? > > -- > 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?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the help Bill. I switched the tags to use the ruby code, which http://www-128.ibm.com/developerworks/web/library/x-introajaxrails/index.html has an example of using an observer as well. -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Fred, Fred wrote:> Thanks for the help Bill.You''re welcome.> I switched the tags to use the ruby code, which > http://www-128.ibm.com/developerworks/web/library/x-introajaxrails/index.html > has an example of using an observer as well.Glad you got it working. And thanks for providing the link. I''m sure that''ll save somebody else time in the future. 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?hl=en -~----------~----~----~----~------~----~------~--~---