Rails 3 update View with JS after new record
I am fetching tweets using the tweetstream gem
and I create a record for every single tweet. index.html.erb
lists all t开发者_高级运维he saved tweets. But I have to reload manually to see the new ones.
How do I get startet with a JS/jQuery code that should watch the records in my database and update the view/append the new tweet everytime a new record is saved?
Thanks in advance
http://www.w3schools.com/js/js_timing.asp
I am not sure if this is what you are looking for, but you could use a javascript time out function to loop on a loaded page checking for updates, see above link for the examples.
精彩评论