Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Optional Previous and Next links

#91

The view helper always generates previous and next links. I would prefer to have a choice about whether they are generated or not.

This patch gives you that choice. By setting the :prev_label and :next_label view helper options to '' the links are not generated:

WillPaginate::ViewHelpers.pagination_options[:prev_label] = ''

WillPaginate::ViewHelpers.pagination_options[:next_label] = ''

I've attached a diff.

I couldn't see any tests for the view helper so I haven't added any ;)

Reported by Andy Stewart · August 24th, 2007 @ 12:18 PM

State: resolved
Milestone: none
Assigned to: Mislav Mislav

Activity

  1. Elijah Miller
    Elijah Miller

    I was just to about to do the same thing! It would preferable if it could accept nil too.

    August 24th, 2007 @ 01:04 PM

  2. Andy Stewart
    Andy Stewart

    You can set those options to nil or '' and either way the previous

    and next links will be suppressed.

    This works because I use #blank? on the options to decide what to do.

    Is this what you meant?

    August 24th, 2007 @ 01:15 PM

  3. Elijah Miller
    Elijah Miller

    Yes exactly what I meant! Good work.

    I wish everyone could see the attachments!

    August 24th, 2007 @ 01:20 PM

  4. Chris Wanstrath
    Chris Wanstrath
    • Assigned user changed from Chris Wanstrath to Mislav
    • State changed from new to open

    August 24th, 2007 @ 06:11 PM

  5. Mislav
    Mislav
    • State changed from open to resolved

    Thanks for the suggestion, but I'm determined to keep prev/next links because they are the most important element to pagination. I will never make an option to turn them off.

    With recent changes to the plugin, it's easier to roll your own pagination HTML, anyway.

    December 25th, 2007 @ 02:41 AM

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.