Class: PaginationHelper::FoundationPaginationListLinkRenderer

Inherits:
WillPaginate::ActionView::LinkRenderer
  • Object
show all
Defined in:
app/helpers/pagination_helper.rb

Overview

Override the will_paginate link renderer to create markup that fits the Zurb Foundation pagination components http://thewebfellas.com/blog/2010/8/22/revisited-roll-your-own-pagination-links-with-will_paginate-and-rails-3

Instance Method Summary collapse

Instance Method Details

#gapObject (protected)


22
23
24
# File 'app/helpers/pagination_helper.rb', line 22

def gap
  tag :li, link(super, '#'), class: 'unavailable'
end

#html_container(html) ⇒ Object (protected)


34
35
36
# File 'app/helpers/pagination_helper.rb', line 34

def html_container(html)
  tag(:ul, html, container_attributes)
end

#page_number(page) ⇒ Object (protected)


26
27
28
# File 'app/helpers/pagination_helper.rb', line 26

def page_number(page)
  tag :li, link(page, page, rel: rel_value(page)), class: ('current' if page == current_page)
end

#previous_or_next_page(page, text, classname) ⇒ Object (protected)


30
31
32
# File 'app/helpers/pagination_helper.rb', line 30

def previous_or_next_page(page, text, classname)
  tag :li, link(text, page || '#'), class: [classname[0..3], classname, ('unavailable' unless page)].join(' ')
end