Class: Blacklight::Response::PaginationComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Blacklight::Response::PaginationComponent
- Defined in:
- app/components/blacklight/response/pagination_component.rb
Overview
Render a pagination widget for search results
Instance Method Summary collapse
- #configured_options ⇒ Object
- #html_attr ⇒ Object
-
#initialize(response:, html: {}, **pagination_args) ⇒ PaginationComponent
constructor
A new instance of PaginationComponent.
- #pagination ⇒ Object
Methods inherited from Component
reset_compiler!, sidecar_files, upstream_sidecar_files
Constructor Details
#initialize(response:, html: {}, **pagination_args) ⇒ PaginationComponent
Returns a new instance of PaginationComponent.
9 10 11 12 13 |
# File 'app/components/blacklight/response/pagination_component.rb', line 9 def initialize(response:, html: {}, **pagination_args) @response = response @html = html @pagination_args = pagination_args end |
Instance Method Details
#configured_options ⇒ Object
24 25 26 |
# File 'app/components/blacklight/response/pagination_component.rb', line 24 def controller.blacklight_config.index. end |
#html_attr ⇒ Object
15 16 17 |
# File 'app/components/blacklight/response/pagination_component.rb', line 15 def html_attr { aria: { label: t('views.pagination.aria.container_label') } }.merge(@html) end |
#pagination ⇒ Object
19 20 21 22 |
# File 'app/components/blacklight/response/pagination_component.rb', line 19 def pagination args = .merge(@pagination_args).compact helpers.paginate @response, **args end |