# Change number of pages in paging

**URL:** <https://www.ruby-forum.com/t/change-number-of-pages-in-paging/169009>\
**Category:** Rails\
**Created:** [May 28, 2009, 12:02pm UTC](https://www.ruby-forum.com/t/change-number-of-pages-in-paging/169009 "2009-05-28T12:02:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fRAnKEnSTEin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/0ea827/32.png) [@fRAnKEnSTEin](https://www.ruby-forum.com/u/fRAnKEnSTEin)\
**Post date:** [May 28, 2009, 12:02pm UTC](https://www.ruby-forum.com/t/change-number-of-pages-in-paging/169009/1 "2009-05-28T12:02:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fRAnKEnSTEin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/0ea827/32.png) [@fRAnKEnSTEin](https://www.ruby-forum.com/u/fRAnKEnSTEin)\
**Post date:** [May 28, 2009, 4:16pm UTC](https://www.ruby-forum.com/t/change-number-of-pages-in-paging/169009/2 "2009-05-28T16:16:15Z")

</div>

On Thu, May 28, 2009 at 12:01 PM, fRAnKEnSTEin [removed\_email\_address@domain.invalid](mailto: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://ramblingsonrails.com)

[http://MyMvelope.com](http://MyMvelope.com) - The SIMPLE way to manage your savings
