I am using Kaminari gem with my rails 3.2 application. Its working fine. Now i want to add a custom page number text field where user can provide a page number and by hitting return key should load the required page number. What is the best approach to implement this functionality?
Asked
Active
Viewed 277 times
1 Answers
0
Each of the result pages differ in the parameter used for page
.
Eg: If the main url is http://www.my_site.com/my_list, the urls for the various pages would look as follows:
- First page: http://www.my_site.com/my_list
- Second page: http://www.my_site.com/my_list?page=2
- Third page: http://www.my_site.com/my_list?page=3
- ...
So you just need to set page=params[:required_page_number]
to get the right page.

Prakash Murthy
- 12,923
- 3
- 46
- 74