Forum: Ruby on Rails Can I send a redirect_to() call to a periodically_call_remot

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Df31a543d684be5fd6bc6c188d378615?d=identicon&s=25 Stuart Hungerford (Guest)
on 2006-05-03 18:57
(Received via mailing list)
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
5dad93417a7379a2343583d083335912?d=identicon&s=25 Brian Ã?gren (Guest)
on 2006-05-03 18:57
(Received via mailing list)
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>
Ef0db53920b243d6758c2f6b1306df0d?d=identicon&s=25 Steve Ross (cwd)
on 2006-05-03 18:58
(Received via mailing list)
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%...
Sent from the RubyOnRails Users forum at Nabble.com.
This topic is locked and can not be replied to.