RJS and PeriodicalUpdater -- example?

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

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… :slight_smile:

–Al Evans

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs