Sha256: eb87e571ced39c5fce85f2f7969a3f8220ddee6d206a01cb860b2b752dc03e1c
Contents?: true
Size: 778 Bytes
Versions: 13
Compression:
Stored size: 778 Bytes
Contents
# This handy simplification is adapted from SphinxSearch (thanks) # and originally came from Ultrasphinx # it saves us a lot of including and bodging to make will_paginate's template calls work in the Page model module Library class LinkRenderer < WillPaginate::LinkRenderer def initialize(tag) @tag = tag end def page_link(page, text, attributes = {}) linkclass = %{ class="#{attributes[:class]}"} if attributes[:class] linkrel = %{ rel="#{attributes[:rel]}"} if attributes[:rel] %Q{<a href="#{@tag.locals.page.url}?page=#{page}"#{linkrel}#{linkclass}>#{text}</a>} end def page_span(page, text, attributes = {}) spanclass = attributes[:class] %{<span class="#{attributes[:class]}">#{text}</span>} end end end
Version data entries
13 entries across 13 versions & 2 rubygems