Hi, this should be easy: I have a "test.rjs" and I want to call it from the :complete of a form_remote_tag. How would I do that? Thanks, Max --~--~---------~--~----~------------~-------~--~----~ 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 Max, Max wrote:> I have a "test.rjs" and I want to call it from the :complete > of a form_remote_tag. > > How would I do that?I''m not sure you can. I''m pretty sure that the callback options on form_remote_tag are only useful for calling javascript that''s already in the page that''s loaded in the browser. 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 -~----------~----~----~----~------~----~------~--~---
> I''m not sure you can. I''m pretty sure that the callback options on > form_remote_tag are only useful for calling javascript that''s already in the > page that''s loaded in the browser.So where should I put the code instead? --~--~---------~--~----~------------~-------~--~----~ 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 Max, Max wrote:>> I''m not sure you can. I''m pretty sure that the callback >> options on form_remote_tag are only useful for calling >> javascript that''s already in the page that''s loaded in the >> browser. > > So where should I put the code instead?That would depend on what you''re trying to do. You didn''t post the .rjs so I can''t say for sure. In general, given what you''ve said, if you want to execute javascript on completion of the form submission, I''d say write the javascript, put it in application.js, and it''ll be available to you on :complete. 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?hl=en -~----------~----~----~----~------~----~------~--~---
Use a form_remote tag and then post it to the controller. Call an RJS action from there. That should work. Vish On 6/18/07, Bill Walton <bill.walton-xwVYE8SWAR3R7s880joybQ@public.gmane.org> wrote:> > Hi Max, > > Max wrote: > > >> I''m not sure you can. I''m pretty sure that the callback > >> options on form_remote_tag are only useful for calling > >> javascript that''s already in the page that''s loaded in the > >> browser. > > > > So where should I put the code instead? > > That would depend on what you''re trying to do. You didn''t post the .rjs so > I can''t say for sure. In general, given what you''ve said, if you want to > execute javascript on completion of the form submission, I''d say write the > javascript, put it in application.js, and it''ll be available to you on > :complete. > > 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?hl=en -~----------~----~----~----~------~----~------~--~---
> Use a form_remote tag and then post it to the controller. Call an RJS > action from there. That should work.Thanks, I solved my initial problem in a completely different way, but I''ll come back to it and try that. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---