Sha256: 3d0c5c4d359148c853f3f56db0eb2c7bbd28c432169f6232a3bb16e92b5ac854

Contents?: true

Size: 706 Bytes

Versions: 4

Compression:

Stored size: 706 Bytes

Contents

# frozen_string_literal: true

require_relative './record_first_for_helper'
require_relative './record_last_for_helper'

module Pagination
  module RecordRangeForHelper
    include Pagination::CurrentPageForHelper
    include Pagination::TotalPagesForHelper
    include Pagination::RecordFirstForHelper
    include Pagination::RecordLastForHelper

    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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
actionset-0.11.0 lib/action_set/helpers/pagination/record_range_for_helper.rb
actionset-0.10.0 lib/action_set/helpers/pagination/record_range_for_helper.rb
actionset-0.9.2 lib/action_set/helpers/pagination/record_range_for_helper.rb
actionset-0.9.1 lib/action_set/helpers/pagination/record_range_for_helper.rb