hi there
was hoping to make a PR to handle the issues noted in https://github.com/thoughtbot/administrate/issues/158
Here is what I thought might solve the solution.
def paginate(resources)
if resources.page(params[:page]).klass.respond_to?(:per)
resources.page(params[:page]).per(records_per_page)
elsif resources.page(params[:page]).klass.respond_to?(:paginate)
resources.page(params[:page]).paginate(records_per_page)
else
resources = resources.page(params[:page]).per(records_per_page) # what should go here?
end
end
some guidance / general direction much appreciated. i will be able to do the rest.
Hi @BKSpurgeon!
Thanks for opening this and I'm sorry it's taken me a long time to look at it.
I'd suggest creating a new entry in Appraisals. You'll be able to add will_paginate there 鈥hat for sure looks like the commonest experience people have with a different pagination library.
Ok i'll have to have a look at that library. I'm not too familiar with it at this stage. hopefully i can get a successful PR to address this issue. chrs
@BKSpurgeon It's been a little while now. Is there anything I can help with?
Yes, I wasn't really sure what to do exactly.
All i need is a pointer in the right direction and i can do the rest :)
@nickcharlton Hi Nick, any pointers here? Some people might be using the new pagination gem: pagy - which might cause some issues with the above.
I'm going to close this, as it's been a while.
Administrate only supports using Kaminari so trying to use will_paginate will be quite difficult. Much like Pagy (see: #1441), it'd have to be quite compelling to switch to it, but there has been some discussion about abstracting the pagination handling so that you could slot your own in.
Most helpful comment
@nickcharlton Hi Nick, any pointers here? Some people might be using the new pagination gem: pagy - which might cause some issues with the above.