You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got pagination in a few places in my application. For all of them I'd like to display the same number of results, and with the same pagination options.
So far, I'm setting the number of results in an initializer:
Kaminari::DEFAULT_PER_PAGE = 15 # Doesn't feel right
And creating a helper for the pagination links:
def custom_paginate(records)
paginate records, :window => 3
end
Then from the other places I call the helper:
= custom_paginate(@pages)
Perhaps there could be a simpler way to set some these options in order to overried Kaminari's defaults?
Thanks!
The text was updated successfully, but these errors were encountered:
I've got pagination in a few places in my application. For all of them I'd like to display the same number of results, and with the same pagination options.
So far, I'm setting the number of results in an initializer:
Kaminari::DEFAULT_PER_PAGE = 15 # Doesn't feel right
And creating a helper for the pagination links:
def custom_paginate(records)
paginate records, :window => 3
end
Then from the other places I call the helper:
= custom_paginate(@pages)
Perhaps there could be a simpler way to set some these options in order to overried Kaminari's defaults?
Thanks!
The text was updated successfully, but these errors were encountered: