Rails 3 equivalent for periodically_call_remote

后端 未结 6 1280
刺人心
刺人心 2020-11-29 04:05

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

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 04:49

    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);
      });
    

提交回复
热议问题