Module: Pagination::RecordRangeForHelper

Includes:
CurrentPageForHelper, RecordFirstForHelper, RecordLastForHelper, TotalPagesForHelper
Included in:
RecordDescriptionForHelper
Defined in:
lib/action_set/helpers/pagination/record_range_for_helper.rb

Instance Method Summary collapse

Methods included from RecordLastForHelper

#pagination_record_last_for

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

Methods included from RecordFirstForHelper

#pagination_record_first_for

Instance Method Details

#pagination_record_range_for(set) ⇒ Object



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

def pagination_record_range_for(set)
  current_page = pagination_current_page_for(set)
  total_pages = pagination_total_pages_for(set)
  return 'None' if current_page > total_pages

  [
    pagination_record_first_for(set),
    '–',
    pagination_record_last_for(set)
  ].join(' ').html_safe
end