from ajax to rails

Hi everyone:

I want to pass the next function to a rails in my view, because I tried
it but the results don´t be succesful. Anyone can help me? I know that
Ajax.PeridicalUpdater is periodically_remote call in ruby but don´t know
how to put in my view for obtain the same result that the following
function. THANKS!!!

<script type="text/javascript">
function lastSpy() {

            var target = $('imagen');

            if (!target) return false;
      new Ajax.PeriodicalUpdater(target,
http://localhost:3000/’,{frequency:'0.25’})
}

       Event.observe(window, 'load', lastSpy, false);
    </script>