Auto refresh of page in Rails 3 using javascript
- by teknull
I have a view in my rails app: blah.app/units/status
This displays a status of all my units. I'd like to have the page automatically refresh via javascript but I'm not sure how to do it.
I tried writing this but it doesn't reload:
<script>
$(function() {
setInterval(function(){
$.getScript("/units/status");
}, 10000);
});
</script>
Can someone point out where I'm going wrong here?