Forum: Ruby on Rails will_paginate customisation

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-18 10:01
Hi,
I am using the will_paginate plugin for my application.
It is showing Prevoius 1,2,3...22,23,24 Next
but I like to have My view Page as
First Previous Next Last instad of showing the numbers,
How will I customise the plugin?
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-05-18 10:28
(Received via mailing list)
On May 18, 9:01 am, Doel Sengupta <rails-mailing-l...@andreas-s.net>
wrote:
> Hi,
> I am using the will_paginate plugin for my application.
> It is showing Prevoius 1,2,3...22,23,24 Next
> but I like to have My view Page as
> First Previous Next Last instad of showing the numbers,
> How will I customise the plugin?

Take a look at the api docs for will paginate (http://gitrdoc.com/
mislav/will_paginate/tree/master/ ) will_paginate takes various
options that allow you to control what labels are used (or you can
even write your own link renderer if you need even more control.

Fred
110e527af05961700d9e39285d043b62?d=identicon&s=25 Gianluca Tessarolo (Guest)
on 2009-05-18 16:23
(Received via mailing list)
You can use :page_links => false

    # ==== Options
    # Display options:
    # * <tt>:previous_label</tt> -- default: "« Previous" (this
parameter is called <tt>:prev_label</tt> in versions <b>2.3.2</b> and
older!)
    # * <tt>:next_label</tt> -- default: "Next »"
    # * <tt>:page_links</tt> -- when false, only previous/next links are
rendered (default: true)
    # * <tt>:inner_window</tt> -- how many links are shown around the
current page (default: 4)
    # * <tt>:outer_window</tt> -- how many links are around the first
and the last page (default: 1)
    # * <tt>:separator</tt> -- string separator for page HTML elements
(default: single space)
This topic is locked and can not be replied to.