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

Cover Title Author names Genre Price Publisher Active
10
Tor Books 13
Ace 15
Orbit 14
Gollancz 11
DAW 15
Baen 10
The Ancient Ocean 17 Martha Wells, Ted Chiang, and Stanisław Lem Fiction 34.01 € Baen
The Ancient Ocean 19 Frank Herbert Fiction 43.54 € Baen
The Hidden Door 22 Frank Herbert Fiction 30.21 € Baen
The Endless Tower 30 Liu Cixin, Ted Chiang, and Becky Chambers Nonfiction 38.98 € Baen
The Ancient Mirror 56 Stanisław Lem and Joe Abercrombie Nonfiction 37.08 € Baen
The Broken Dune 63 Liu Cixin and Mary Shelley Fiction 6.27 € Baen
The Luminous Ocean 64 Becky Chambers and Stanisław Lem Fiction 33.85 € Baen
The Ancient Signal 88 Becky Chambers and Frank Herbert Fiction 19.15 € Baen
The Hidden Door 95 Mary Shelley Fiction 21.22 € Baen
The Luminous Empire 97 Liu Cixin Fiction 13.61 € Baen
Del Rey 13
Vintage 19