# How I can stop periodically\_call\_remote?

**URL:** <https://www.ruby-forum.com/t/how-i-can-stop-periodically-call-remote/57112>\
**Category:** Rails\
**Created:** [April 7, 2006, 9:33am UTC](https://www.ruby-forum.com/t/how-i-can-stop-periodically-call-remote/57112 "2006-04-07T09:33:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilyas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/f04885/32.png) [@ilyas](https://www.ruby-forum.com/u/ilyas)\
**Post date:** [April 7, 2006, 9:33am UTC](https://www.ruby-forum.com/t/how-i-can-stop-periodically-call-remote/57112/1 "2006-04-07T09:33:44Z")

</div>

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  
}  
}

---

<div class="post-metadata">

**Author:** ![ilyas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/f04885/32.png) [@ilyas](https://www.ruby-forum.com/u/ilyas)\
**Post date:** [April 23, 2007, 3:59pm UTC](https://www.ruby-forum.com/t/how-i-can-stop-periodically-call-remote/57112/2 "2007-04-23T15:59:31Z")

</div>

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.
