# Periodically\_call\_remote helper

**URL:** <https://www.ruby-forum.com/t/periodically-call-remote-helper/119640>\
**Category:** Rails\
**Created:** [November 8, 2007, 8:49pm UTC](https://www.ruby-forum.com/t/periodically-call-remote-helper/119640 "2007-11-08T20:49:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [November 8, 2007, 8:49pm UTC](https://www.ruby-forum.com/t/periodically-call-remote-helper/119640/1 "2007-11-08T20:49:19Z")

</div>

Hello…

I’m very new to Rails/Ajax but I’m trying to get this to work and  
just  
can’t seem to figure out what I’m doing wrong.

I would like to take a value and pass it to a method in my  
controller. I would like to refresh the DIV every 60 seconds.

I’m trying to use the periodically\_call\_remote helper.

This is the call I’m making  
\<%= periodically\_call\_remote(  
:update =\> ‘responses’,  
:frequency =\> 60,  
:url =\> {:action =\> ‘newly\_posted’},  
:with =\> “‘id=’ + encodeURIComponent($$("div#responses \>  
div#[^=links\_]").first().readAttribute(‘ID’).substring(5))”  
)  
%\>

I have tried calling $$(“div#responses \>  
div#[^=links\_]”).first().readAttribute(‘ID’).substring(5) in the  
Firebug console and it returns just what I expect it to.

When I go to the page and open the Firebug console, I can see  
GET [http://localhost:3000/data.html404](http://localhost:3000/data.html404) (344ms) getting called every  
couple of seconds then an error every minute or so. I assume the  
error is my periodically\_call\_remote code getting called.

This is the error I see in the log file.  
ActionController::RoutingError (no route found to match “/data.html”  
with {:method=\>:get}):

I don’t understand what is happening. Why are these GET calls being  
made back to the server and what is “/data.html”?

Any help or insight would be greatly appreciated
