我实现了以下自定义链接呈现器类:
  
  class PaginationListLinkRenderer < 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 && page != current_page
      page_link(page, text, :class => span_class)
    else
      page_span(page, text, :class => 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 
  
   这主要是
   
    http://thewebfellas.com/blog/2008/8/3/roll-your-own-pagination-links-with-will_paginate
   
  
  
   不过,有一个问题是,有70页要分页,我设置了:inner_window=>2和:outer_window=>2,分页产生:
  
  
   1 2 3 4 5 65 66 67
  
  
   如何在页码中添加介于5和65之间的“…”分隔符?