Is there a way to make Kaminari always show pagination controls even when total page count is 1?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can extend Kaminari at run-time, a process known as [monkey-patching]. Just create a file in config/initializers/kaminari_ext.rb with the following:
You will need to restart your rails server for the changes to take effect.
If you get an error about num_pages being nil you can change num_pages within a theme, changing it to total_pages. Eventually num_pages will be deprecated in lieu of total_pages.
For example, I had to change _page.html.haml: