periodically_call_remote helper


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