# Change parameters to periodically\_call\_remote

**URL:** <https://www.ruby-forum.com/t/change-parameters-to-periodically-call-remote/190754>\
**Category:** Rails\
**Created:** [June 26, 2010, 8:05pm UTC](https://www.ruby-forum.com/t/change-parameters-to-periodically-call-remote/190754 "2010-06-26T20:05:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![candor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/13edae/32.png) [@candor](https://www.ruby-forum.com/u/candor)\
**Post date:** [June 26, 2010, 8:05pm UTC](https://www.ruby-forum.com/t/change-parameters-to-periodically-call-remote/190754/1 "2010-06-26T20:05:05Z")

</div>

Hi,

I have a search box (id=:phrase) on my rails ajax page. I want a  
periodically call remote poller to update a div whenever the value in  
that box changes.

On the page containing the search box, I have the following:  
\<%= periodically\_call\_remote(:url =\> update\_query\_topics\_url,  
:with =\> “$(‘phrase’).serialize()”,  
:frequency =\> 1.0)%\>

I have also tried:

\<%= observe\_field(:phrase, :url =\> update\_query\_topics\_url,  
:with =\> “$(‘phrase’).serialize()”,  
:frequency =\> 1.0)%\>

The issue is that the phrase value is not picked up when it changes in  
either case. The update continues to use the first phrase value,  
unless the page is refreshed.

I also tried assigning the phrase from the rjs on clicking the submit  
button beside the search box:

page.assign “phrase”, @query.phrase

However, the only way to get the periodically\_call\_remote or the  
observe\_field seems to be to refresh the page.

How do I get the update to happen whenever the phrase changes? I need  
the poller, because the actual retrieving of topics based on the query  
will run in a delayed job.

Thanks  
Anand
