Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General configuration options #41

Closed
javierv opened this issue Feb 27, 2011 · 2 comments
Closed

General configuration options #41

javierv opened this issue Feb 27, 2011 · 2 comments

Comments

@javierv
Copy link

javierv commented Feb 27, 2011

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!

amatsuda added a commit that referenced this issue Apr 21, 2011
make DEFAULT_PER_PAGE configurable via Kaminiar.configure method
amatsuda added a commit that referenced this issue Apr 21, 2011
configurable values are: window, outer_window, left, right
@amatsuda
Copy link
Member

Thanks for a nice suggestion!
Added a general configuration class and a generator of the config file.
amatsuda/kaminari@7473663...91d6628

Hope you like it.

@javierv
Copy link
Author

javierv commented Jul 7, 2011

I'm a bit late, but anyway, that's awesome! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants