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.
482517e3e7f1be3c858dbdb4b8f288a1?d=identicon&s=25 fRAnKEnSTEin (Guest)
on 2009-05-28 12: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
5772c599ccab3081e0fffb1d54f3b6de?d=identicon&s=25 Andrew Timberlake (andrewtimberlake)
on 2009-05-28 16:16
(Received via mailing list)
On Thu, May 28, 2009 at 12:01 PM, fRAnKEnSTEin <shirkavand@gmail.com>
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 Timberlake
http://ramblingsonrails.com

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