Customizing Number of Page Links Rendered With will_paginate?
Asked Answered
A

1

17

I'm using the will_paginate gem for my Rails project and it's working beautifully. Unfortunately, on paginated result sets with a larger number of pages, the link section is too wide. Instead of:

« Previous 1 2 … 5 6 7 8 9 10 11 12 13 … 18 19 Next »

I would like to show:

« Previous 1 2 … 5 6 7 8 9 … 18 19 Next »

How can I reduce the number of page links being rendered? I looked at the will_paginate docs on github but couldn't find a solution.

Thanks! Moe

Allay answered 15/4, 2010 at 1:36 Comment(0)
C
27

Use the :inner_window option:

<%= will_paginate stuff, :inner_window => 2 %>

You can see all the options right here.

Cherenkov answered 15/4, 2010 at 1:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.