Class: Railsboot::PaginationComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/railsboot/pagination_component.rb

Overview

ViewComponent: renders the pagination block.

Instance Method Summary collapse

Constructor Details

#initialize(pagy:) ⇒ PaginationComponent

Returns a new instance of PaginationComponent.



4
5
6
# File 'app/components/railsboot/pagination_component.rb', line 4

def initialize(pagy:)
  @pagy = pagy
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'app/components/railsboot/pagination_component.rb', line 8

def render?
  @pagy.present? && @pagy.last.to_i > 1
end