Module: Pagination::RecordLastForHelper

Includes:
CurrentPageForHelper, PageSizeForHelper, RecordSizeForHelper, TotalPagesForHelper
Included in:
RecordRangeForHelper
Defined in:
lib/action_set/helpers/pagination/record_last_for_helper.rb

Instance Method Summary collapse

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

#pagination_record_last_for(set) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/action_set/helpers/pagination/record_last_for_helper.rb', line 15

def pagination_record_last_for(set)
  record_size = pagination_record_size_for(set)
  current_page = pagination_current_page_for(set)
  page_size = pagination_page_size_for(set)
  total_pages = pagination_total_pages_for(set)

  return record_size if current_page >= total_pages

  current_page * page_size
end