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 :catalog). 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: :catalog %> <%# search, filters, sort, actions %>
<%= crud_filter @books, fieldset: :catalog %> <%# filter sidebar (the model, or the list's scope) %>
Read more: Fields & cells · Views & fieldsets
| Cover | Title | Subtitle | Author names | Genre | Price | Pages | Published on | Publisher | Reviews | Active | Manual | Created at | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
||||||||||
![]() |
The Distant Door 26 | — | Ann Leckie, Iain Banks, and Liu Cixin | Nonfiction | 16.40 € | 177 | 1993-05-16 | Gollancz | — | ✓ | — | 05 Oct 15:21 | ||
![]() |
The Ancient Ocean 74 | — | Margaret Atwood | Nonfiction | 14.70 € | 131 | 1961-09-13 | Gollancz | Edsger on The Ancient Ocean 74, Radia on The Ancient Ocean 74, Barbara on The Ancient Ocean 74 +1 more | ✓ | — | 05 Oct 15:21 | ||
![]() |
The Broken City 102 | — | Ann Leckie, Margaret Atwood, and Frank Herbert | Nonfiction | 40.54 € | 136 | 1954-04-21 | Gollancz | Ada on The Broken City 102, Radia on The Broken City 102, Alan on The Broken City 102 +1 more | ✓ | — | 05 Oct 15:21 | ||


