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
— 8
Tor Books 6
The Endless Dune 17 Joe Abercrombie, Mary Shelley, and Stanisław Lem Fiction 18.69 € Tor Books ✓
The Endless Winter 28 Iain Banks, Liu Cixin, and Ted Chiang Fiction 29.97 € Tor Books ✓
The Distant Forest 38 Adrian Tchaikovsky and Octavia Butler Fiction 38.71 € Tor Books ✓
The Ancient Garden 42 Iain Banks Fiction 35.86 € Tor Books ✓
The Ancient Dune 67 Mary Shelley and Ann Leckie Fiction 38.41 € Tor Books ✓
The Quiet Station 95 Adrian Tchaikovsky, Ursula Le Guin, and Stanisław Lem Fiction 6.29 € Tor Books ✓
Ace 5
Orbit 4
Gollancz 4
The Broken Engine 9 Ted Chiang, Ann Leckie, and Frank Herbert Fiction 32.99 € Gollancz ✗
The Ancient Mirror 24 Mary Shelley Fiction 33.42 € Gollancz ✓
The Hidden Dune 79 Martha Wells and Ursula Le Guin Fiction 24.25 € Gollancz ✓
The Distant Winter 96 Martha Wells and Becky Chambers Fiction 10.36 € Gollancz ✓
DAW 6
Del Rey 2
Vintage 8