inner_window, outer_window not working. #293

Closed
stoplion opened this Issue Feb 14, 2013 · 2 comments

2 participants

@stoplion

The Collection I'm trying to render has the methods current_page, total_pages but both inner_window and outer_window have no effect.

Tried to add it the initializer..

 WillPaginate::ViewHelpers.pagination_options[:inner_window] = 1
 WillPaginate::ViewHelpers.pagination_options[:outer_window] = 1

..and within the will_paginate call itself.

.pagination_wrapper
   = will_paginate collection, \
    previous_label: "« prev", \
    next_label: "next »", \
    params: { controller: "employer_facets", \
    inner_window: 2, \
    outer_window: 2, \
    action: "navigate" }

// Collection.current_page is 1
// Collection.total_pages is 5

@mislav
Owner

What was the outcome that led you to the conclusion that the parameters have no effect?

Tip: while experimenting, remove the global settings in the initializer and configure everything inline in the will_paginate call itself.

@stoplion

This ended up being an issue with how the Collection was retuned on the backend, totally unrelated to Will Paginate. I'll close the issue. Thanks for the tip. I'll use that in the future.

@stoplion stoplion closed this Mar 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment