Html 如何为merb中的will_paginate添加自定义渲染器?

Html 如何为merb中的will_paginate添加自定义渲染器?,html,ruby-on-rails,ruby,will-paginate,merb,Html,Ruby On Rails,Ruby,Will Paginate,Merb,由于我需要以这种方式完成分页标记: 某页 我想将自定义渲染器添加到Merb应用程序。当我把代码 module SearchPagination class LinkRenderer < WillPaginate::ActionView::LinkRenderer protected def windowed_page_numbers inner_window = @options[:inner_window].to_i window_f

由于我需要以这种方式完成分页标记:

  • 某页

我想将自定义渲染器添加到Merb应用程序。当我把代码

module SearchPagination
  class LinkRenderer < WillPaginate::ActionView::LinkRenderer
    protected
    def windowed_page_numbers
      inner_window = @options[:inner_window].to_i
      window_from = current_page
      window_to = current_page + inner_window

      # adjust upper limit if out of bounds
      window_to = total_pages if window_to > total_pages
      left = (window_from..window_to).to_a
      left << :gap if total_pages > window_to
      left
   end
 end
那么,如何以正确的方式连接这些东西呢

<%= will_paginate @channels, :renderer => SearchPagination::LinkRenderer %>
uninitialized constant Merb::InlineTemplates::SearchPagination - (NameError)