Hi i''m trying to update a select box with a newly created record, the problem is that to create this record i open a popup window. How can I update the select box with the record information created in the popup window, is there a way to observer model changes and updates the view based on that changes? Please I really need help on this, I read a lot of forum and articles and i could not find anything. 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-/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 -~----------~----~----~----~------~----~------~--~---
Jesus bernardo Ruiz flores wrote:> Hi i''m trying to update a select box with a newly created record, the > problem is that to create this record i open a popup window. > > How can I update the select box with the record information created in > the popup window, is there a way to observer model changes and updates > the view based on that changes? > > Please I really need help on this, I read a lot of forum and articles > and i could not find anything.Are you trying to update the select field without reloading the page? If so, you''ll need to use JavaScript. I recommend jQuery (http://jquery.com), but Rails comes with Prototype (http://prototypejs.org). If you have nil experience with JavaScript and you''re pressed for time (or are impatient) I recommend forgoing the Ajax experience and reloading the page. Hope that helps, if not, respond with more information. :) -- 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 -~----------~----~----~----~------~----~------~--~---
You need a remote_form (ie AJAX) that updates the element in the (named) original form of the window that calls the popup. Just to make perfectly clear, you need to set the html NAME and ID property of the form tag on the page that calls the pop-up window, because the pop up window has to reference inside of that form to update the select tag. Julian. Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #3 out NOW! http://sensei.zenunit.com/ On 10/04/2008, at 12:51 AM, Jesus bernardo Ruiz flores wrote:> > Hi i''m trying to update a select box with a newly created record, the > problem is that to create this record i open a popup window. > > How can I update the select box with the record information created in > the popup window, is there a way to observer model changes and updates > the view based on that changes? > > Please I really need help on this, I read a lot of forum and articles > and i could not find anything. > > 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-/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 -~----------~----~----~----~------~----~------~--~---
Daniel Waite wrote:> > Are you trying to update the select field without reloading the page? If > so, you''ll need to use JavaScript. > > I recommend jQuery (http://jquery.com), but Rails comes with Prototype > (http://prototypejs.org). > > If you have nil experience with JavaScript and you''re pressed for time > (or are impatient) I recommend forgoing the Ajax experience and > reloading the page. > > Hope that helps, if not, respond with more information. :)Yes i''m trying to update the select field without reloading the page. I''ll check the prototype -- 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 -~----------~----~----~----~------~----~------~--~---
Julian Leviston wrote:> You need a remote_form (ie AJAX) that updates the element in the > (named) original form of the window that calls the popup. > > Just to make perfectly clear, you need to set the html NAME and ID > property of the form tag on the page that calls the pop-up window, > because the pop up window has to reference inside of that form to > update the select tag. > > Julian. > > Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) > VIDEO #3 out NOW! > http://sensei.zenunit.com/Sorry to bother you with this, but can you send me an example of how to do this? Thank ypu very much -- 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 -~----------~----~----~----~------~----~------~--~---
Not unless you''re prepared to pay me to do it, unfortunately. I may release a video on how to do it sometime. Julian. Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #3 out NOW! http://sensei.zenunit.com/ On 11/04/2008, at 5:38 AM, Jesus bernardo Ruiz flores wrote:> > Julian Leviston wrote: >> You need a remote_form (ie AJAX) that updates the element in the >> (named) original form of the window that calls the popup. >> >> Just to make perfectly clear, you need to set the html NAME and ID >> property of the form tag on the page that calls the pop-up window, >> because the pop up window has to reference inside of that form to >> update the select tag. >> >> Julian. >> >> Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) >> VIDEO #3 out NOW! >> http://sensei.zenunit.com/ > > Sorry to bother you with this, but can you send me an example of how > to > do this? > > Thank ypu very much > -- > 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 -~----------~----~----~----~------~----~------~--~---