# RJS and PeriodicalUpdater -- example?

**URL:** <https://www.ruby-forum.com/t/rjs-and-periodicalupdater-example/98759>\
**Category:** Rails\
**Created:** [July 18, 2006, 12:29am UTC](https://www.ruby-forum.com/t/rjs-and-periodicalupdater-example/98759 "2006-07-18T00:29:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![al-evans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@al-evans](https://www.ruby-forum.com/u/al-evans)\
**Post date:** [July 18, 2006, 12:29am UTC](https://www.ruby-forum.com/t/rjs-and-periodicalupdater-example/98759/1 "2006-07-18T00:29:43Z")

</div>

In a controller, I’m trying to do

def do\_some\_periodic\_thing  
render :update  
page \<\< ‘var foo = new Ajax.PeriodicalUpdater(“someDiv”,  
“/some/path”, {asynchronous:true, frequency:1, evalScripts:true} );’  
end  
end

In the view, I have

\<%= link\_to\_remote “Test Periodical”, :url =\> { :action =\>  
“do\_some\_periodic\_thing”}%\>

But according to the log, /some/path never gets called.

Evidently, I’m doing something dumb or ignorant.

Can somebody give me an example of how this should be done? Or some  
pointers to web sites I should have found?

Thanks in advance…

–Al Evans

---

<div class="post-metadata">

**Author:** ![al-evans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@al-evans](https://www.ruby-forum.com/u/al-evans)\
**Post date:** [July 18, 2006, 2:20am UTC](https://www.ruby-forum.com/t/rjs-and-periodicalupdater-example/98759/2 "2006-07-18T02:20:15Z")

</div>

Al Evans wrote:

> But according to the log, /some/path never gets called.

I made some progress. I must have had an error in the code for making  
the PeriodicalUpdater. So now I’m getting the callbacks I expect.

However, I’m still not getting scripts from the callback method to be  
evaluated, though I set evalScripts:true in the PeriodicalUpdater.  
Instead, I get the script rendered as text.

So I still need a clue, if anybody’s got a spare… 🙂

–Al Evans
