Howdy Folks, I have a a button that launches an RJS call and it works beautifully. It updates a bunch of other areas on the page and brings in the most recent data. Great stuff! I would like to enable ''auto-updates'' for my app - basically I would like to have the browser periodically invoke the RJS call so that every 60 seconds or so, everything is updated. I know that Prototype has the ''PeriodicalUpdater'' but that is based around AjaxUpdater and from everything I have read and seen, AjaxRequest is used in RJS, not AjaxUpdater. Has anyone done anything like this? Can anyone point me in the right direction and rescue me from meta-refresh hell? Any help *very* much appreciated. Cheers, HH --~--~---------~--~----~------------~-------~--~----~ 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~ On Sep 20, 2006, at 9:05 PM, HH wrote:> > Howdy Folks, > > I have a a button that launches an RJS call and it works > beautifully. It > updates a bunch of other areas on the page and brings in the most > recent > data. Great stuff! > > I would like to enable ''auto-updates'' for my app - basically I > would like to > have the browser periodically invoke the RJS call so that every 60 > seconds > or so, everything is updated. > > I know that Prototype has the ''PeriodicalUpdater'' but that is based > around > AjaxUpdater and from everything I have read and seen, AjaxRequest > is used in > RJS, not AjaxUpdater. > > Has anyone done anything like this? Can anyone point me in the right > direction and rescue me from meta-refresh hell? > > Any help *very* much appreciated. > > Cheers,Hey HH- You want the periodically_call_remote helper. Its perfect for this. Lets assume the action you want to periodically call is called ping: <%= periodically_call_remote(:url => {:action => ''ping''}, :frequency => 5) %> That will call the ping action once every 5 seconds. -Ezra --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yeah, this works fantastic. Thanks.> From: Ezra Zygmuntowicz <ezmobius-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Reply-To: <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > Date: Wed, 20 Sep 2006 21:22:36 -0700 > To: <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > Subject: [Rails] Re: Periodic RJS Calls? > > > Hi~ > > > On Sep 20, 2006, at 9:05 PM, HH wrote: > >> >> Howdy Folks, >> >> I have a a button that launches an RJS call and it works >> beautifully. It >> updates a bunch of other areas on the page and brings in the most >> recent >> data. Great stuff! >> >> I would like to enable ''auto-updates'' for my app - basically I >> would like to >> have the browser periodically invoke the RJS call so that every 60 >> seconds >> or so, everything is updated. >> >> I know that Prototype has the ''PeriodicalUpdater'' but that is based >> around >> AjaxUpdater and from everything I have read and seen, AjaxRequest >> is used in >> RJS, not AjaxUpdater. >> >> Has anyone done anything like this? Can anyone point me in the right >> direction and rescue me from meta-refresh hell? >> >> Any help *very* much appreciated. >> >> Cheers, > > > Hey HH- > > You want the periodically_call_remote helper. Its perfect for this. > Lets assume the action you want to periodically call is called ping: > > <%= periodically_call_remote(:url => {:action => ''ping''}, :frequency > => 5) %> > > That will call the ping action once every 5 seconds. > > -Ezra > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---