# Pagination

**URL:** <https://www.ruby-forum.com/t/pagination/168290>\
**Category:** Rails\
**Created:** [May 19, 2009, 8:50am UTC](https://www.ruby-forum.com/t/pagination/168290 "2009-05-19T08:50:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![doelsengupta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cc9497/32.png) [@doelsengupta](https://www.ruby-forum.com/u/doelsengupta)\
**Post date:** [May 19, 2009, 8:50am UTC](https://www.ruby-forum.com/t/pagination/168290/1 "2009-05-19T08:50:32Z")

</div>

Hi,  
Thanx for the sugestion regarding the view of the pagination, but the  
code is not available in the site,  
[http://www.smashingmagazine.com/2007/11/16/pagination-gallery-examples-and-good-practices/](http://www.smashingmagazine.com/2007/11/16/pagination-gallery-examples-and-good-practices/)

I have written the code for the First and Last links in the  
collection.rb file as,

def first(\*args)  
if args.first.kind\_of?(Integer) || (@found &&  
!args.first.kind\_of?(Hash))  
proxy\_found.first(\*args)  
else  
find(:first, \*args)  
end  
end

def last(\*args)  
if args.first.kind\_of?(Integer) || (@found &&  
!args.first.kind\_of?(Hash))  
proxy\_found.last(\*args)  
else  
find(:last, \*args)  
end  
end

but I can’t find the place where they have to be called in the  
will\_paginate method in the view\_helpers.rb file.

Moreover, I have commented out the two methods def visible\_page\_numbers  
and def visible\_page\_numbers in the view\_helpers.rb file but it has no  
effect in the hide the display of the numbers 1 2 3 4…8 9 10.  
how to hide the display of the numbers 1 2 3 4…8 9 10?

Thanx in advance!

---

<div class="post-metadata">

**Author:** ![doelsengupta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cc9497/32.png) [@doelsengupta](https://www.ruby-forum.com/u/doelsengupta)\
**Post date:** [May 19, 2009, 9:38am UTC](https://www.ruby-forum.com/t/pagination/168290/2 "2009-05-19T09:38:06Z")

</div>

On May 19, 7:50 am, Doel S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi,  
> Thanx for the sugestion regarding the view of the pagination, but the  
> code is not available in the site,[http://www.smashingmagazine.com/2007/11/16/pagination-gallery-example](http://www.smashingmagazine.com/2007/11/16/pagination-gallery-example)…
> 
> I have written the code for the First and Last links in the  
> collection.rb file as,

Have you tried just passing :page\_links =\> false to will\_paginate ?  
You could also supply a custom subclass of WillPaginate::LinkRenderer,  
would be easier than monkey patching will paginate

Fred
