I'd like to have just a part of my page updated every second. I know I can get this to work using setInterval in JavaScript but what if I want some logic built into my Rails code? Here's a simple abstraction:
Code in controller:
def lookup_something
@stuff_to_display = [code to look up a set of records]
end
Then in the view:
<body>
<div id="update_this"></div>
</body>
I'd like something to run that action every second and update the div
above. I know I've done this before in a previous project with a relatively simple block of code but I can't find out how to do it again for the life of me.