Sha256: bf119d9c941cb3ea7063b10bb2fc581585d4541ee5c1c882c53119cbc64c81ee
Contents?: true
Size: 885 Bytes
Versions: 44
Compression:
Stored size: 885 Bytes
Contents
# frozen_string_literal: true class Avo::PaginatorComponent < ViewComponent::Base attr_reader :pagy attr_reader :turbo_frame attr_reader :index_params attr_reader :resource attr_reader :parent_record attr_reader :discreet_pagination def initialize(resource: nil, parent_record: nil, pagy: nil, turbo_frame: nil, index_params: nil, discreet_pagination: nil) @pagy = pagy @turbo_frame = turbo_frame @index_params = index_params @resource = resource @parent_record = parent_record @discreet_pagination = discreet_pagination end def change_items_per_page_url(option) if parent_record.present? helpers.related_resources_path(parent_record, parent_record, per_page: option, keep_query_params: true, page: 1) else helpers.resources_path(resource: resource, per_page: option, keep_query_params: true, page: 1) end end end
Version data entries
44 entries across 44 versions & 1 rubygems