Grouped table

How this page is built the gem renders it — this is all you write

Grouping is a render-time arrangement, like the layout. Add group_by: :publisher — the gem orders by the group key, splits the rows into collapsible groups (chevron in the header) and shows a per-group count. With 55 books, groups start collapsed beyond config.group_collapse_threshold (default 50), opening only the first; the open ones live in ?open=, so a half-expanded view is copy-pasteable.

app/views/groups/index.html.erb
<%= crud_collection @books, group_by: :publisher %>   <%# belongs_to, enum or a column %>

Read more: Grouping

Reset
Cover Title Author names Genre Price Publisher Active
Reset
— 2
The Burning Winter 6 Octavia Butler Scifi 21.78 € — ✓
The Endless Station 11 Joe Abercrombie Scifi 10.86 € — ✓
Tor Books 1
Ace 2
The Burning Tower 20 Ann Leckie Scifi 14.56 € Ace ✓
The Endless Winter 30 Octavia Butler Scifi 39.19 € Ace ✓
Orbit 1
Gollancz 1
DAW 4
The Distant City 10 Stanisław Lem, Ted Chiang, and Liu Cixin Scifi 26.91 € DAW ✓
The Hidden Engine 23 Stanisław Lem, Adrian Tchaikovsky, and Becky Chambers Scifi 40.55 € DAW ✗
The Quiet City 27 Frank Herbert Scifi 39.79 € DAW ✓
The Silent Archive 40 Ann Leckie Scifi 41.43 € DAW ✓
Del Rey 2
Vintage 2
The Endless City 21 Ursula Le Guin, Frank Herbert, and Octavia Butler Scifi 36.46 € Vintage ✓
The Broken Dune 49 Margaret Atwood and Mary Shelley Scifi 22.90 € Vintage ✓