module Paginators
class Numbered
attr_reader :template, :source
delegate :url, :total_pages, :current_page, :to => :source
def initialize(template, source)
@template = template
@source = source
end
def pagination_html
html = "
"
html.html_safe
end
protected
def pagination_item(page, current_page)
html = ""
if page == "..."
html << "..."
elsif page == current_page
html << page.to_s
else
html << template.link_to(page, url(template, :page => page))
end
html << ""
html.html_safe
end
end
end