You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
module PaginateHelper
|
|
def paginate(objs, **opts)
|
|
page = params[:page].to_i <= 0 ? 1 : params[:page].to_i
|
|
per_page = params[:per_page].to_i > 0 ? params[:per_page].to_i : opts[:per_page] || 20
|
|
|
|
Kaminari.paginate_array(objs).page(page).per(per_page)
|
|
end
|
|
end |