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 120 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
— 6
Tor Books 6
Ace 3
Orbit 3
Gollancz 3
DAW 2
The Ancient Forest 93 Liu Cixin and Kim Robinson Fiction 41.21 € DAW ✓
The Hidden Garden 99 Frank Herbert Fiction 24.11 € DAW ✓
Del Rey 2
Vintage 8
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 Hidden Engine 31 Becky Chambers, Mary Shelley, and Stanisław Lem Fiction 32.85 € Vintage ✓
The Quiet Empire 59 Kim Robinson, Liu Cixin, and Ted Chiang Fiction 39.87 € Vintage ✓
The Luminous Station 94 Adrian Tchaikovsky and Mary Shelley Fiction 26.90 € Vintage ✓
The Dispossessed Ocean 101 Ann Leckie Fiction 12.58 € Vintage ✓
The Hidden Garden 109 Ted Chiang Fiction 22.95 € Vintage ✓
The Quiet Forest 113 Adrian Tchaikovsky and Octavia Butler Fiction 33.56 € Vintage ✓