module Folio::WillPaginate::ViewHelpers::LinkRenderer

Public Class Methods

included(klass) click to toggle source
# File lib/folio/will_paginate/view_helpers/link_renderer.rb, line 43
def self.included(klass)
  [:previous_page, :next_page, :link, :rel_value].each do |method|
    klass.send(:alias_method, :"#{method}_without_folio", method)
    klass.send(:alias_method, method, :"#{method}_with_folio")
  end
end

Public Instance Methods

next_page_with_folio() click to toggle source
# File lib/folio/will_paginate/view_helpers/link_renderer.rb, line 13
def next_page_with_folio
  # the page identifier may not be ordinal; use the value as set on the
  # collection, instead.
  previous_or_next_page(@collection.next_page, @options[:next_label], 'next_page')
end
previous_page_with_folio() click to toggle source
# File lib/folio/will_paginate/view_helpers/link_renderer.rb, line 7
def previous_page_with_folio
  # the page identifier may not be ordinal; use the value as set on the
  # collection, instead.
  previous_or_next_page(@collection.previous_page, @options[:previous_label], 'previous_page')
end
rel_value_with_folio(page) click to toggle source
# File lib/folio/will_paginate/view_helpers/link_renderer.rb, line 33
def rel_value_with_folio(page)
  # don't check against mathed out values, just check the values on the
  # collection
  rels = []
  rels << 'prev' if page == @collection.previous_page
  rels << 'next' if page == @collection.next_page
  rels << 'start' if page == @collection.first_page
  rels.empty? ? nil : rels.join(' ')
end