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
4
The Endless Dune 26 Ursula Le Guin and Joe Abercrombie Fiction 26.43 €
The Endless Ocean 79 Liu Cixin Fiction 24.96 €
The Dispossessed Dune 102 Frank Herbert, Joe Abercrombie, and Mary Shelley Fiction 37.91 €
The Quiet Dune 115 Ursula Le Guin Fiction 42.25 €
Tor Books 4
The Hidden Garden 16 Joe Abercrombie, Ted Chiang, and Becky Chambers Fiction 30.44 € Tor Books
The Quiet Machine 31 Margaret Atwood Fiction 21.83 € Tor Books
The Ancient Engine 32 Octavia Butler Fiction 33.11 € Tor Books
The Endless Station 47 Joe Abercrombie and Kim Robinson Fiction 26.37 € Tor Books
Ace 4
The Ancient Door 34 Margaret Atwood and Mary Shelley Fiction 32.79 € Ace
The Hidden Mirror 35 Ann Leckie Fiction 27.24 € Ace
The Distant Dune 104 Becky Chambers and Iain Banks Fiction 25.09 € Ace
The Distant Winter 118 Joe Abercrombie Fiction 16.33 € Ace
Orbit 6
Gollancz 3
DAW 3
Baen 8
Del Rey 3
Vintage 6