Class: RubyUIAdmin::UI::Pagination
- Defined in:
- app/components/ruby_ui_admin/ui/pagination.rb
Overview
Orchestrates RubyUI's Pagination primitives (PaginationContent / PaginationItem / PaginationEllipsis) from a Pagy instance: numbered page links with gaps, plus Previous/Next. In countless mode (no total) it shows Previous/Next only.
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(pagy:, url_for_page:, countless: false, **attrs) ⇒ Pagination
constructor
A new instance of Pagination.
- #view_template ⇒ Object
Constructor Details
#initialize(pagy:, url_for_page:, countless: false, **attrs) ⇒ Pagination
Returns a new instance of Pagination.
9 10 11 12 13 14 |
# File 'app/components/ruby_ui_admin/ui/pagination.rb', line 9 def initialize(pagy:, url_for_page:, countless: false, **attrs) @pagy = pagy @url_for_page = url_for_page @countless = countless super(**attrs) end |
Instance Method Details
#view_template ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'app/components/ruby_ui_admin/ui/pagination.rb', line 16 def view_template nav(**attrs) do render PaginationContent.new do render_edge(:prev) render_series unless @countless render_edge(:next) end end end |