Rails 3 equivalent for periodically_call_remote

后端 未结 6 1269
刺人心
刺人心 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:54

    If you want to continue using prototype.js, so you can do what follows:

    <%= content_for :js do %>
      new Ajax.PeriodicalUpdater("mydiv", 
        "/controller/action", 
        { frequency: 5, 
          method: 'get' })
    <% end %>
    

    More about Ajax.PeriodicalUpdater here.

提交回复
热议问题