Forum: Ruby on Rails How I can stop periodically_call_remote?

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.
Ilyas (Guest)
on 2006-04-07 11:33
I need make progress bar with following function:

# Ruby on Rails code
<%= periodically_call_remote(:update => 'progress-bar', :url => {
:action =>   :progress },
:frequency => 0.1 , :complete => "check(request)") %>


How I can stop it?
If I have this:

/* JavaScript code */
function check(request, object) {
         if (request.responseText == 'abort') {
            // code for stop periodically update
         }
}
Nanyang Z. (Guest)
on 2007-04-23 17:59
Ilyas wrote:
> I need make progress bar with following function:
>
> # Ruby on Rails code
> <%= periodically_call_remote(:update => 'progress-bar', :url => {
> :action =>   :progress },
> :frequency => 0.1 , :complete => "check(request)") %>
>
>
> How I can stop it?
you can add a :condition option to the periodically_call_remote, making
the method depend on the checkbox's value. when checkbox is checked/(or
unchecked), the method stop to call.
This topic is locked and can not be replied to.