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 77 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
— 10
Tor Books 8
Ace 8
Orbit 4
Gollancz 5
DAW 5
The Distant City 10 Stanisław Lem, Ted Chiang, and Liu Cixin Scifi 26.91 € DAW ✓
The Quiet City 27 Frank Herbert Scifi 39.79 € DAW ✓
The Dispossessed Winter 29 Ted Chiang and Ann Leckie Nonfiction 9.04 € DAW ✓
The Silent Archive 40 Ann Leckie Scifi 41.43 € DAW ✓
The Dispossessed City 66 Octavia Butler Scifi 29.12 € DAW ✓
Baen 5
Del Rey 7
The Quiet Mirror 5 Kim Robinson, Liu Cixin, and Becky Chambers Nonfiction 32.73 € Del Rey ✓
The Endless Forest 15 Octavia Butler, Ann Leckie, and Liu Cixin Scifi 11.84 € Del Rey ✓
The Endless Winter 25 Ann Leckie Fiction 41.02 € Del Rey ✓
The Hidden Tower 47 Martha Wells Nonfiction 19.92 € Del Rey ✓
The Ancient Ocean 53 Martha Wells and Ursula Le Guin Fiction 25.74 € Del Rey ✓
The Dispossessed Empire 54 Margaret Atwood, Octavia Butler, and Stanisław Lem Nonfiction 43.50 € Del Rey ✓
The Endless Signal 73 Frank Herbert, Iain Banks, and Margaret Atwood Scifi 19.39 € Del Rey ✓
Vintage 10
The Endless Mirror 2 Ann Leckie, Mary Shelley, and Ursula Le Guin Nonfiction 28.63 € Vintage ✓
The Dispossessed City 7 Liu Cixin, Octavia Butler, and Kim Robinson Fiction 17.82 € Vintage ✓
The Hidden Mirror 19 Joe Abercrombie, Ursula Le Guin, and Adrian Tchaikovsky Fiction 37.51 € Vintage ✓
The Endless City 21 Ursula Le Guin, Frank Herbert, and Octavia Butler Scifi 36.46 € Vintage ✓
The Hidden Engine 31 Becky Chambers, Mary Shelley, and Stanisław Lem Fiction 32.85 € Vintage ✓
The Broken Dune 49 Margaret Atwood and Mary Shelley Scifi 22.90 € Vintage ✓
The Quiet Empire 59 Kim Robinson, Liu Cixin, and Ted Chiang Fiction 39.87 € Vintage ✓
The Endless City 69 Kim Robinson and Ursula Le Guin Scifi 40.98 € Vintage ✓
The Hidden Tower 75 Frank Herbert Scifi 5.34 € Vintage ✓
The Luminous Tower 77 Kim Robinson, Frank Herbert, and Joe Abercrombie Scifi 28.81 € Vintage ✓