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
2
Tor Books 4
Ace 2
The Broken Machine 42 Ted Chiang Nonfiction 25.55 € Ace
The Luminous Tower 89 Joe Abercrombie, Liu Cixin, and Margaret Atwood Nonfiction 22.68 € Ace
Orbit 6
Gollancz 3
DAW 4
Baen 2
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
Del Rey 3
Vintage 7
The Endless Mirror 2 Ann Leckie, Mary Shelley, and Ursula Le Guin Nonfiction 28.63 € Vintage
The Endless Empire 5 Ann Leckie Nonfiction 25.88 € Vintage
The Ancient Ocean 44 Becky Chambers Nonfiction 25.72 € Vintage
The Silent Mirror 60 Ann Leckie and Kim Robinson Nonfiction 25.07 € Vintage
The Quiet Dune 76 Mary Shelley Nonfiction 24.14 € Vintage
The Endless Winter 84 Iain Banks Nonfiction 34.31 € Vintage
The Silent Dune 107 Stanisław Lem and Octavia Butler Nonfiction 17.86 € Vintage