# Can I send a redirect\_to() call to a periodically\_call\_remot

**URL:** <https://www.ruby-forum.com/t/can-i-send-a-redirect-to-call-to-a-periodically-call-remot/59322>\
**Category:** Rails\
**Created:** [May 3, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/can-i-send-a-redirect-to-call-to-a-periodically-call-remot/59322 "2006-05-03T18:57:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stuart\_Hungerford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b38774/32.png) [@Stuart\_Hungerford](https://www.ruby-forum.com/u/Stuart_Hungerford)\
**Post date:** [May 3, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/can-i-send-a-redirect-to-call-to-a-periodically-call-remot/59322/1 "2006-05-03T18:57:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Stuart\_Hungerford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b38774/32.png) [@Stuart\_Hungerford](https://www.ruby-forum.com/u/Stuart_Hungerford)\
**Post date:** [May 3, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/can-i-send-a-redirect-to-call-to-a-periodically-call-remot/59322/2 "2006-05-03T18:57:24Z")

</div>

i fairly new at rails (haven’t even tried out RJS yet) … but you’ll  
need to  
send the equivalent of

---

<div class="post-metadata">

**Author:** ![Stuart\_Hungerford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b38774/32.png) [@Stuart\_Hungerford](https://www.ruby-forum.com/u/Stuart_Hungerford)\
**Post date:** [May 3, 2006, 6:58pm UTC](https://www.ruby-forum.com/t/can-i-send-a-redirect-to-call-to-a-periodically-call-remot/59322/3 "2006-05-03T18:58:46Z")

</div>

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()-call-to-a-periodically\_call\_remote()-function-](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](http://Nabble.com).
