# Will paginate - how to display ... and restrict number of pages?

**URL:** <https://www.ruby-forum.com/t/will-paginate-how-to-display-and-restrict-number-of-pages/127297>\
**Category:** Rails\
**Created:** [January 27, 2008, 10:53pm UTC](https://www.ruby-forum.com/t/will-paginate-how-to-display-and-restrict-number-of-pages/127297 "2008-01-27T22:53:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bparanj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e9a140/32.png) [@bparanj](https://www.ruby-forum.com/u/bparanj)\
**Post date:** [January 27, 2008, 10:53pm UTC](https://www.ruby-forum.com/t/will-paginate-how-to-display-and-restrict-number-of-pages/127297/1 "2008-01-27T22:53:09Z")

</div>

I want the digg style pagination which looks like this:  
[http://www.strangerstudios.com/sandbox/pagination/diggstyle.php](http://www.strangerstudios.com/sandbox/pagination/diggstyle.php)

Does anyone know how to make the will\_paginate plugin to restrict the  
number of page links between the previous and next links? TIA.

–  
[http://www.rubyplus.org/](http://www.rubyplus.org/)  
Free Ruby and Rails Screencasts

---

<div class="post-metadata">

**Author:** ![bparanj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e9a140/32.png) [@bparanj](https://www.ruby-forum.com/u/bparanj)\
**Post date:** [January 27, 2008, 11:05pm UTC](https://www.ruby-forum.com/t/will-paginate-how-to-display-and-restrict-number-of-pages/127297/2 "2008-01-27T23:05:37Z")

</div>

The :inner\_window option tells the will\_paginate view helper how many  
links to display before and after the current page. So if you’re  
displaying page 100 of 200, and :inner\_window is 2, then there would  
be links to 98, 99, (current page), 101, 102.

The :outer\_window option determines the number of links that print  
just after the beginning (“Prev”) and just before the end (“Next”) of  
the list of links. Using the same example as before, setting  
the :outer\_window to 3 would result in this:  
Next 1 2 3 … 98 99 (current page) 101 102 … 198 199 200 Prev

Brad
