Module: Pagination::LastPageLinkForHelper

Includes:
CurrentPageForHelper, PathForHelper, TotalPagesForHelper
Included in:
LinksForHelper
Defined in:
lib/action_set/helpers/pagination/last_page_link_for_helper.rb

Instance Method Summary collapse

Methods included from PathForHelper

#pagination_path_for

Methods included from Params::CurrentHelper

#current_params

Methods included from TotalPagesForHelper

#pagination_total_pages_for

Methods included from PageSizeForHelper

#pagination_page_size_for

Methods included from RecordSizeForHelper

#pagination_record_size_for

Methods included from CurrentPageForHelper

#pagination_current_page_for

Instance Method Details



13
14
15
16
17
18
19
20
21
22
# File 'lib/action_set/helpers/pagination/last_page_link_for_helper.rb', line 13

def pagination_last_page_link_for(set)
  current_page = pagination_current_page_for(set)
  total_pages = pagination_total_pages_for(set)

  if current_page != total_pages && current_page <= total_pages
    link_to('Last »',  pagination_path_for(total_pages), class: 'page-link page-last')
  else
    (:span, 'Last »', class: 'page-link page-last disabled')
  end
end