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.
Doel S. (Guest)
on 2009-05-18 12: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?
Frederick C. (Guest)
on 2009-05-18 12:28
(Received via mailing list)
On May 18, 9:01 am, Doel S. <removed_email_address@domain.invalid>
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
Gianluca T. (Guest)
on 2009-05-18 18: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.