Forum: Ruby on Rails Ajax: periodicaly_call_remote problem

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.
783fed8af50259766b40d2f550ec5974?d=identicon&s=25 zven (Guest)
on 2006-06-07 15:57
(Received via mailing list)
Hello

I am using 'periodically_call_remote' to get some stats from database
and display it every N seconds, it's works fine, but when I rewriting
(by page.replace ...) content of the DIV which contains
'periodically_call_remote' definition request are still executing...
How to fix this confuse?

Thanks in advance.
D0cd6b10e01bacb976b3b815a9c660bc?d=identicon&s=25 Alex Wayne (Guest)
on 2006-06-07 18:35
zven wrote:
> Hello
>
> I am using 'periodically_call_remote' to get some stats from database
> and display it every N seconds, it's works fine, but when I rewriting
> (by page.replace ...) content of the DIV which contains
> 'periodically_call_remote' definition request are still executing...
> How to fix this confuse?
>
> Thanks in advance.

You're going to have to clarify your question to get a response from
this list.  I'm not sure anyone understands what your problem is.
783fed8af50259766b40d2f550ec5974?d=identicon&s=25 zven (Guest)
on 2006-06-07 19:26
(Received via mailing list)
On Wed, 2006-06-07 at 18:35 +0200, Alex Wayne wrote:

> You're going to have to clarify your question to get a response from
> this list.  I'm not sure anyone understands what your problem is.
>

How to stop periodically_call_remote?

Simple example:

View:

<div id="view">
  <%= link_to_remote 'Stop tracking', :url => { :action => 'stop' } %>
  <%= periodically_call_remote :url => { :action =>
'track_all' }, :update => 'tracking' %>
  <div id="tracking"></div>
</div>

Controller:

def track_something
  # DATABASE ACCESS HERE
  ....
  render :partial => 'track'
end

def stop
  render :update do |page|
    page.remove 'view'
  end
end

When 'stop' action executed, database access still work... It's strange
isn't it?
This topic is locked and can not be replied to.