Vasseurth
Vasseurth

Reputation: 6486

Error when using ActiveAdmin and Pagination

I was using will_paginate to paginate my reports, however, I tried to add ActiveAdmin and I get errors. So I did some research and realized that AA uses kaminari, so I swapped from will_paginate to kaminari, but I get this error undefined methodcurrent_page' for #because of this line of code<%= paginate @reports %>`. Everything, is there a special way to install kaminari? Anyone else have this problem?

Upvotes: 0

Views: 935

Answers (1)

Kleber S.
Kleber S.

Reputation: 8240

Seems that you are using the same variable name and 2 or more actions. Try to use a different variable name.

def index
  @reports = Report.page(params[:page])
end

def list
  @report_list = Report.list.page(params[:page])
end

Try simple changing your variables. It should work!

Upvotes: 1

Related Questions