开发者

AJAX in Rails - doing simple looping to update information when available

开发者 https://www.devze.com 2022-12-23 19:11 出处:网络
I am trying to get put out a simple site, which would pool the database every few seconds and update the information on the page dynamicly, when theres something new inserted.

I am trying to get put out a simple site, which would pool the database every few seconds and update the information on the page dynamicly, when theres something new inserted.

I am farily new to ruby, but I understand the whole concept of RJS, link_to_function and soforth. The question is, what is the best way how to implement some kind of simple loop, which would run af开发者_运维问答ter the page is loaded and update the DOM if there is something new to display.

Thanks in advance for any tips!


checkout rails prototype helper method: periodically_call_remote

http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M001647

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号