title: Rails 3 - Periodic Refresh of DIV
body: <p>I am trying to refresh the contents of a div using AJAX/Unobtrusive JavaScript/JQuery.  </p>
  
  <p>This is easy to do if I make a "refresh" link and give it a data-remote attribute.</p>
  
  <p>However, I would like to refresh every 2 seconds using the setInterval function rather than using a link.</p>
  
  <p>This code should demonstrate what I'm trying to do.  It does not work when put in application.js because the ERB is not evaluated, but hopefully it will explain my goal.</p>
  
  <pre><code>  setInterval(function(){
      $("#scuttlebutt").html("&lt;%= escape_javascript(render 'scuttlebutt') %&gt;");
    },2000);
  </code></pre>
  
  <p>What would be a proper way to do this in Rails 3??</p>
  
  <p>(I am working with Rails 3.2.5)</p>