I just have a simple index page which shows all the items of an ActiveRecord. What I'd like to have is that the table containing the items gets automatically refreshed every X seconds (i.e. loaded from the DB and rendered). I already redefined the index action as a partial rendering
[app/admin/item.rb]
ActiveAdmin.register Item do
index do
render :partial => "items_list"
end
end
And then I have
[app/views/admin/items/_items_list.html.erb]
(I don't mind using ERB or ARB to write the partial) The list table is rendered correctly when I first load the page.
I'm not sure which Javascript I should include in the page to refresh the list every X seconds. More specifically, which URL should be called by the Javascript command? Do I need to define any custom action in the controller?
Thank you for any advice.
Thomas