Pagination
How this page is built
the gem renders it — this is all you write
The gem doesn't paginate on its own (no surprise row limits). You paginate in your controller with your own gem — here kaminari — and because a kaminari-paginated relation carries its page state, crud_collection notices and renders the footer pager automatically. The pager's ?page= composes with the gem's own filter/sort params (120 seeded books, 8 per page).
app/controllers/books_controller.rb
@query = CrudComponents::Query.new(Book, params, fieldset: :index, ability: current_ability)
@books = @query.apply(Book.all).page(params[:page]).per(8) # kaminari
app/views/pagination/index.html.erb
<%= crud_collection @books, query: @query %> <%# the footer pager renders itself %>
Read more: Pagination
| Cover | Title | Author names | Genre | Price | Publisher | Active | ||
|---|---|---|---|---|---|---|---|---|
|
|
|
|||||||
![]() |
The Endless Mirror 98 | Adrian Tchaikovsky, Martha Wells, and Ann Leckie | Nonfiction | 33.32 € | DAW | ✓ | ||
![]() |
The Broken City 102 | Ann Leckie, Margaret Atwood, and Frank Herbert | Nonfiction | 40.54 € | Gollancz | ✓ | ||
![]() |
The Hidden Door 106 | Martha Wells, Mary Shelley, and Stanisław Lem | Nonfiction | 19.30 € | Orbit | ✓ | ||
![]() |
The Luminous Ocean 108 | Ted Chiang | Nonfiction | 39.89 € | Orbit | ✗ | ||
![]() |
The Burning Station 110 | Mary Shelley | Nonfiction | 24.38 € | Baen | ✓ | ||
![]() |
The Distant Archive 111 | Frank Herbert | Nonfiction | 11.59 € | DAW | ✓ | ||
![]() |
The Ancient Archive 114 | Frank Herbert, Kim Robinson, and Margaret Atwood | Nonfiction | 44.21 € | Ace | ✓ | ||






