Sha256: 2710eb945485ba72a6b277d559ec3e1f0d906eba5741923c802c72faf1947634

Contents?: true

Size: 780 Bytes

Versions: 14

Compression:

Stored size: 780 Bytes

Contents

# frozen_string_literal: true

require_relative './current_page_for_helper'
require_relative './total_pages_for_helper'
require_relative './path_for_helper'

module Pagination
  module NextPageLinkForHelper
    include Pagination::CurrentPageForHelper
    include Pagination::TotalPagesForHelper
    include Pagination::PathForHelper

    def pagination_next_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('Next ›', pagination_path_for(current_page + 1), rel: 'next', class: 'page-link page-next')
      else
        content_tag(:span, 'Next ›', class: 'page-link page-next disabled')
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
actionset-0.11.0 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.10.0 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.9.2 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.9.1 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.8.2 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.8.1 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.8.0 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.7.0 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.6.0 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.5.4 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.5.3 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.5.2 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.5.1 lib/action_set/helpers/pagination/next_page_link_for_helper.rb
actionset-0.5.0 lib/action_set/helpers/pagination/next_page_link_for_helper.rb