Hi, I am using the will_paginate plugin for my application. It is showing Previous 1,2,3...22,23,24 Next links How will I hide the numbers? I want to have first and last links also. How will i do that? Thanks in advance. -- Posted via http://www.ruby-forum.com/.
Hi Doel, here I found inside of the README of this plugin a interesting link with a lot of examples. See here at http://www.smashingmagazine.com/2007/11/16/pagination-gallery-examples-and-good-practices/ Good luck _______________________________________________ Gnu/Linux count user #416024 My personal page : http://www.cesardiaz.com.ar My blog : http://cesarediaz.blogspot.com Twitter : http://twitter.com/cesarstafe My github account: http://github.com/cesarediaz Skype: cesarstafe On Mon, May 18, 2009 at 9:04 AM, Doel Sengupta <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi, > I am using the will_paginate plugin for my application. > It is showing Previous 1,2,3...22,23,24 Next links > How will I hide the numbers? > I want to have first and last links also. How will i do that? > Thanks in advance. > -- > Posted via http://www.ruby-forum.com/. > > > >
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/ 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! -- Posted via http://www.ruby-forum.com/.
On May 19, 7:50 am, Doel Sengupta <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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... > > 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> 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! > -- > Posted viahttp://www.ruby-forum.com/.