How this page is built
the gem renders it — this is all you write
A full table — search, an inline filter row, sortable columns and row actions — all derived from the model. This page toggles between the curated :index and the fuller :catalog fieldset (currently :index). Your controller assigns @books — scope it for authorization (e.g. Book.accessible_by(current_ability)) and the gem renders that scope.
app/models/book.rb
crud_structure do
attribute :price, as: :number, unit: '€', digits: 2
fieldset :index, %i[cover title author_names genre price publisher active]
fieldset :catalog, %i[cover title subtitle author_names genre price purchase_price
shop_margin pages published_on publisher reviews active manual created_at]
end
app/views/books/index.html.erb
<%= crud_collection @books, fieldset: :index %> <%# search, filters, sort, actions %>
<%= crud_filter @books, fieldset: :index %> <%# filter sidebar (the model, or the list's scope) %>
Read more: Fields & cells · Views & fieldsets
| Cover | Title | Author names | Genre | Price | Publisher | Active | ||
|---|---|---|---|---|---|---|---|---|
|
|
|
|
||||||
![]() |
The Distant Door 26 | Ann Leckie, Iain Banks, and Liu Cixin | Nonfiction | 16.40 € | Gollancz | ✓ | ||
![]() |
The Endless Winter 28 | Iain Banks, Liu Cixin, and Ted Chiang | Fiction | 29.97 € | Tor Books | ✓ | ||
![]() |
The Ancient Garden 42 | Iain Banks | Fiction | 35.86 € | Tor Books | ✓ | ||
![]() |
The Ancient Garden 43 | Frank Herbert, Iain Banks, and Becky Chambers | Fiction | 42.67 € | Orbit | ✓ | ||
![]() |
The Ancient Forest 56 | Iain Banks, Ursula Le Guin, and Kim Robinson | Scifi | 33.64 € | Orbit | ✓ | ||
![]() |
The Distant Tower 63 | Iain Banks, Liu Cixin, and Joe Abercrombie | Scifi | 18.55 € | Baen | ✓ | ||
![]() |
The Hidden Ocean 65 | Joe Abercrombie, Iain Banks, and Ann Leckie | Nonfiction | 43.18 € | Del Rey | ✗ | ||
![]() |
The Endless Signal 73 | Frank Herbert, Iain Banks, and Margaret Atwood | Scifi | 19.39 € | Del Rey | ✓ | ||
![]() |
The Hidden Engine 78 | Iain Banks | Scifi | 8.00 € | — | ✗ | ||
![]() |
The Luminous City 85 | Liu Cixin, Stanisław Lem, and Iain Banks | Nonfiction | 22.63 € | DAW | ✓ | ||
![]() |
The Hidden Winter 92 | Margaret Atwood, Octavia Butler, and Iain Banks | Nonfiction | 29.93 € | Del Rey | ✓ | ||
![]() |
The Dispossessed Door 103 | Iain Banks and Frank Herbert | Fiction | 30.10 € | Ace | ✗ | ||
![]() |
The Hidden Door 107 | Iain Banks and Mary Shelley | Scifi | 17.84 € | — | ✓ | ||












