Rails 3 等效于periodic_call_remote [英] Rails 3 equivalent for periodically_call_remote

查看:19
本文介绍了Rails 3 等效于periodic_call_remote的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎 periodically_call_remote 在 Rails 3 中已被弃用,任何想法如何实现相同的功能?

Seems like periodically_call_remote is deprecated in Rails 3, any ideas how to achieve the same functionality?

推荐答案

我一直在寻找使用 Rails 3 的正确方法,但现在我确信 Rails 3 中没有与 Periodical_call_remote 等效的方法.为了使用 jQuery 完成完全相同的功能,我使用了:

I was searching for the right way to do it with Rails 3 but now I am confident that there is no equivalent to periodically_call_remote in Rails 3. To get the exact same functionality done with jQuery, I used:

$(document).ready(
  function(){
    setInterval(function(){
      $('#mydiv').load('/controller/action');
    }, 3000);
  });

这篇关于Rails 3 等效于periodic_call_remote的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆