#18 ✓resolved
Cameron Yule

WillPaginate formatting?

Reported by Cameron Yule | October 27th, 2008 @ 09:17 AM

This is a feature request rather than a bug report. :)

I've been wondering if it's easy/possible to use will_paginate for the output of the actual pagination rather than using the Searchgasm#page_select dropdown menu?

Having had a quick look around the WP internals, it's using a custom Collection class which is essentially an Array with a few additional attributes (current_page, per_page etc), so there'd have to be some kind of tie-up there.

Has anyone else attempted this yet?

Comments and changes to this ticket

  • Ben Johnson

    Ben Johnson October 28th, 2008 @ 02:03 AM

    • State changed from “new” to “resolved”
    • Assigned user set to “Ben Johnson”

    Feature requests are always welcome.

    Searchgasm provides page_links and remote_page_links as a helper, which does the exact same thing as will_paginate. If you checkout the helpers configuration you will see options to alter the class names, etc. If you change those class name you can have page_links and remote_page_links output exactly like will_paginate.

    Let me know if this helps.

  • Colin McLeod

    Colin McLeod November 17th, 2008 @ 03:56 PM

    • Assigned user cleared.

    Maybe a will_paginate.compatibility flag in the configs would be ideal as most apps are using will_paginate already and a consistent look and feel for pagination is important to end-users and nice for devs to expect/debug one pagination interface. I did a quick look through both gems and didn't find what exactly to override so that the will_paginate call would work in the views ( as our apps all share common partials with for all model object lists). This is ideal for us to not break out custom search result pages vs other paginated listings. Outside of that small issue this a truly must have gem :)

  • Ben Johnson

    Ben Johnson November 17th, 2008 @ 04:34 PM

    Alright, you've convinced me. I'm not a big fan of the class names will_paginate chooses, but none the less its not my call. So I added:

    config.helpers.page_links_act_like_will_paginate = true

    I also added a few more configuration options. Just update from the repo and checkout the changelog.

    Let me know if you have any issues.

  • Colin McLeod

    Colin McLeod November 17th, 2008 @ 04:58 PM

    Ben, you've just allowed me to move all my custom searching to searchlogic on about 10 different apps. I owe you a beer :)

  • Ben Johnson

    Ben Johnson November 17th, 2008 @ 05:03 PM

    Let me know how it goes, I never used will_paginate because I have always used searchlogic, even before I released it. I just installed will_paginate and took a look at the output. If you have any problems let me know what to change and I'll make it happen.

    And I can never have too much beer, maybe we'll meet at railsconf.

  • Pak24tv

    Pak24tv December 9th, 2020 @ 01:33 AM

    I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept. Thank you for the post. online games

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Provides common named scopes and object based searching.