Forum: Ruby on Rails change number of pages in paging

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
fRAnKEnSTEin (Guest)
on 2009-05-28 14:02
(Received via mailing list)
Hi there,

At this moment will_paginate is showing so many page numbers , for
example:

<< Previous 1 2 3 4 5 6 7 8 9 10 ... 113 114 next >>

I want to configure this, so it will look like:

<< Previous 1 2 3 4 5 ... 113 114 next >>

In other words, i need to change tha amount of pages showed in the
paging, is this configurable?

Regards
Andrew T. (Guest)
on 2009-05-28 18:16
(Received via mailing list)
On Thu, May 28, 2009 at 12:01 PM, fRAnKEnSTEin 
<removed_email_address@domain.invalid>
wrote:
> << Previous 1 2 3 4 5 ... 113 114 next >>
>
> In other words, i need to change tha amount of pages showed in the
> paging, is this configurable?
>
> Regards

A quick look at the documentation will show you that you can configure
will_paginate(@collection) as
will_paginate(@collection, :inner_window => 2, :outer_window => 1)

:inner_window is the number of pages to display around the current
page (default: 4)
:outer_window is the number of pages to display around the first and
last page (default: 1)

Andrew T.
http://ramblingsonrails.com

http://MyMvelope.com - The SIMPLE way to manage your savings
This topic is locked and can not be replied to.