0

I am trying to create a simple dashboard on active admin.

The idea here is to have multiple panels that serve as a quick view of different models. The problem is that when I move between pages it affects all paginators.

I am doing this

paginated_collection(my_collection.page(params[:page_2]).per(5)) do
   table_for collection do |t|
       ...
   end
end

Is it possible to have multiple paginators on active admin for the same page?

Lopes
  • 2,257
  • 2
  • 13
  • 7

1 Answers1

0

It is possible to set the name of the page param. This question is closely related to this answer: https://stackoverflow.com/a/6721703/790737 . ActiveAdmin wraps Kaminari, but will pass the param_name parameter to the pagination links. So I think you should be able to write:

paginated_collection(my_collection.page(params["custom_page_param"]).per(5), :param_name => 'custom_page_param') do
  table_for collection do |t|
     ...
  end
end

Good luck!

Sjors Branderhorst
  • 2,138
  • 17
  • 25