Forum: Ruby on Rails Pagination

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.
C9c80a433227bf2dc2a6cfb4893857e1?d=identicon&s=25 Doel Sengupta (doelsengupta)
on 2009-05-19 08:50
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/paginat...

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!
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-05-19 09:38
(Received via mailing list)
On May 19, 7:50 am, Doel Sengupta <rails-mailing-l...@andreas-s.net>
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/paginat......
>
> 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
This topic is locked and can not be replied to.