Reputation: 165
We're building a statusboard for all our external servers. Each entry in our database has references to OS, Software version, etc. These values are ever changing and we'd like to have the page update specific div's that change in our database. We've already written a polling mechanism to check every 20s for changes and entries are updated within the database immediately. But, we're only able to see them if we refresh the page.
Does rails have a mechanism built-in that would allow us to periodically check the database and update the view based on the new changes without refreshing the page? Should I be using Jquery AJAX commands? If so, how would I implement this?
We're using Rails 3.2.1, Ruby 1.9.2 in conjunction with jquery and twitter-bootstrap.
Any help would be appreciated.
Upvotes: 3
Views: 1239
Reputation: 4305
I know that this is a late reply but I stumbled across it and felt it should have an answer.
You could try this railscast as it uses ajax to poll for changes in a database and dynamically update the view
I'm personally looking for an alternative to this approach but it may be useful to anybody who finds it
Upvotes: 1