Note that there are some explanatory texts on larger screens.

plurals
  1. POWill_Paginate - How to add a separator between the inner_window and outer_window values?
    text
    copied!<p>I have implemented the following custom link renderer class:</p> <pre><code>class PaginationListLinkRenderer &lt; WillPaginate::LinkRenderer def to_html links = @options[:page_links] ? windowed_links : [] links.unshift(page_link_or_span(@collection.previous_page, 'previous', @options[:previous_label])) links.push(page_link_or_span(@collection.next_page, 'next', @options[:next_label])) html = links.join(@options[:separator]) @options[:container] ? @template.content_tag(:ul, html, html_attributes) : html end protected def windowed_links visible_page_numbers.map { |n| page_link_or_span(n, (n == current_page ? 'current' : nil)) } end def page_link_or_span(page, span_class, text = nil) text ||= page.to_s if page &amp;&amp; page != current_page page_link(page, text, :class =&gt; span_class) else page_span(page, text, :class =&gt; span_class) end end def page_link(page, text, attributes = {}) @template.content_tag(:li, @template.link_to(text, url_for(page)), attributes) end def page_span(page, text, attributes = {}) @template.content_tag(:li, text, attributes) end end </code></pre> <p>which is mostly the work of <a href="http://thewebfellas.com/blog/2008/8/3/roll-your-own-pagination-links-with-will_paginate" rel="nofollow noreferrer">http://thewebfellas.com/blog/2008/8/3/roll-your-own-pagination-links-with-will_paginate</a></p> <p>One issue I have though, there are 70 pages to be paginated, I have set the :inner_window=>2 and :outer_window=>2 and the pagination produces:</p> <p>1 2 3 4 5 65 66 67</p> <p>How can I add a "..." seperator between 5 and 65 in the page numbers?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload