How to limit the number of pages displayed in will_paginate links

I want to make the current will_paginate, which looks like this:

<-Previous 1 2 3 4 5 Next->

Look at this

<-Previous 1 2 Next-> 

How can I control the number of pages that can be displayed between previous and next?

+3
source share
1 answer

Properties inner_windowand outer_windowcan be used to control the number of page links that you see on each page. You can pass them to a method will_paginatein your view (if you want to limit the number of links per page).

, , ( - will_paginate.rb). :

WillPaginate::ViewHelpers.pagination_options[:inner_window] = 3
WillPaginate::ViewHelpers.pagination_options[:outer_window] = 2
+12

All Articles