Stuart Hungerford
2006-May-01 07:15 UTC
[Rails] Can I send a redirect_to() call to a periodically_call_remote() function?...
Hi, I''m using Rails 1.1 and the periodically_call_remote() helper to query the server for the progress of a long running action. I''m using the excellent new RJS partials to send a page.replace_html() to update the status information on the page--which works very well. When the action completes I''m also trying to send a redirect_to() by the same approach--which doesn''t seem to work in that the browser window and URL bar are not updated. Is there something special about the context of the periodically_call_remote() function that means I need to force browser redirects in another way? Any advice much appreciated, Stu
Brian Ă…gren
2006-May-01 13:50 UTC
[Rails] Can I send a redirect_to() call to a periodically_call_remote() function?...
i fairly new at rails (haven''t even tried out RJS yet) .. but you''ll need to send the equivalent of <script>document.location.href=''/where/ever/you/want/me/''</script> On 5/1/06, Stuart Hungerford <stuart.hungerford@anu.edu.au> wrote:> > Hi, > > I''m using Rails 1.1 and the periodically_call_remote() helper to > query the server for the progress of a long running action. > > I''m using the excellent new RJS partials to send a page.replace_html() > to update the status information on the page--which works very > well. > > When the action completes I''m also trying to send a redirect_to() > by the same approach--which doesn''t seem to work in that the browser > window and URL bar are not updated. > > Is there something special about the context of the > periodically_call_remote() function that means I need to force > browser redirects in another way? > > Any advice much appreciated, > > Stu > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060501/7ef99a11/attachment.html
s.ross
2006-May-01 22:01 UTC
[Rails] Can I send a redirect_to() call to a periodically_call_remote() function?...
If you use page.redirect_to(''someplace/else'') the javascript sent back to the browser is something like location.href = ''someplace/else''; This should handle your redirect. -- View this message in context: http://www.nabble.com/Can-I-send-a-redirect_to%28%29-call-to-a-periodically_call_remote%28%29-function-...-t1535486.html#a4172286 Sent from the RubyOnRails Users forum at Nabble.com.
Possibly Parallel Threads
- Can I send a redirect_to() call to a periodically_call_remote() refresh?
- Pass parameters in periodically_call_remote?
- Newbie question about periodically_call_remote
- Initial load time when periodically_call_remote
- Is there a huge performance difference between using multiple periodically_call_remote functions or one?