Sha256: 8760ad3f966d864f32ebd7ff9ca8dfd01563b0c3b4e1717ed97d50d7ae4450f4

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

require_relative './first_page_link_for_helper'
require_relative './prev_page_link_for_helper'
require_relative './current_page_description_for_helper'
require_relative './next_page_link_for_helper'
require_relative './last_page_link_for_helper'

module Pagination
  module LinksForHelper
    include Pagination::FirstPageLinkForHelper
    include Pagination::PrevPageLinkForHelper
    include Pagination::CurrentPageDescriptionForHelper
    include Pagination::NextPageLinkForHelper
    include Pagination::LastPageLinkForHelper

    def pagination_links_for(set, **attributes)
      content_tag(:nav,
                  **attributes.merge(
                    class: 'pagination',
                    'aria-label': 'Page navigation'
                  )) do
        safe_join([
          pagination_first_page_link_for(set),
          pagination_prev_page_link_for(set),
          pagination_current_page_description_for(set),
          pagination_next_page_link_for(set),
          pagination_last_page_link_for(set)
        ])
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
actionset-0.7.0 lib/action_set/helpers/pagination/links_for_helper.rb
actionset-0.6.0 lib/action_set/helpers/pagination/links_for_helper.rb
actionset-0.5.4 lib/action_set/helpers/pagination/links_for_helper.rb
actionset-0.5.3 lib/action_set/helpers/pagination/links_for_helper.rb