First, I wouldn''t use the periodically_call inside the refresh div. I
have the feeling that it will vanish at the first call as it will be
replaced by the content if the update.
Anyway, if you want to redirect the user to another page, you cannot
use redirect because the periodical just replace some portion of the
page. So you have to use some JavaScript to tell the browser to change
the page location.
Put something like
JavaScript_tag window.location = new/location/whatever.
You may have to check some option to make sure this piece of code will
be evaluated.
Pardon my errors or typos, but Im on my mobile without access to
reference material.
You should find some info on periodacal on www.prototypejs.org
Good luck
Christophe
Le 8 avr. 2010 à 02:19, Ashwin Vel
<velapanur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> a écrit :
> I am using Periodically_call_remote in the following way
>
> <div id="refresh">
> <%= periodically_call_remote(
> :update => "refresh",
> :frequency => 3,
> :url => { :action => :activate }) %>
> </div>
>
>
> and the action i am calling is shown below. The activate action checks
> for some value in a remote database and once the value says Active
> then i want the user to be redirected to another page. But what is
> happening is that the new page is getting loaded inside the Div
> "refresh" tag. So its a page in page.
>
> def activate
> ---perform something---
> if ( Check = "active")
> redirect to different page
> end
> end
>
> Any idea how i can do rectify this. Any other suggestions are welcome
> too.
>
>
> Ashwin
>
> --
> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
> .
> For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
> .
>
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.