Column picker
How this page is built
the gem renders it — this is all you write
Pass picker: true and a gear appears in the header row: the user ticks which columns are shown and (with the optional crud-columns Stimulus controller) drags to reorder them. It submits ?cols[]= to this same URL — like the sort links and filter row — so it opens and works without JavaScript. The picker groups every column by its source model (Pipedrive-style): own columns under this model, association and path columns under the model they reach — publisher.founded_on under Publisher, authors.email under Author. The selection is always intersected with the permitted set, so a forged ?cols= can only hide or reorder, never reveal one.
app/models/book.rb
fieldset :picker, %i[title genre price publisher publisher.name
publisher.founded_on authors.name authors.email active] # path columns: assoc.attr
app/views/columns/index.html.erb
<%= crud_collection @books, fieldset: :picker,
extra_columns: @columns, <%# declared + path + dynamic — all pickable %>
picker: true %> <%# gear + read ?cols= (picked_columns: :auto) %>
Read more: Column picker · Path columns
| Title | Genre | Price | Publisher | Publisher › Name | Publisher › Founded on | Authors › Name | Authors › Email | Active | Shelf | Weight | Signed | Acquired |
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
||||||||||
| The Endless Station 13 | Fiction | 27.05 € | DAW | DAW | 1971-01-01 | Ann Leckie, Martha Wells, Ursula Le Guin | ann@example.com, martha@example.com, ursula@example.com | ✗ | A1 | 748.0 g | ✗ | 2026-04-16 | ||
| The Burning Archive 100 | Fiction | 24.48 € | — | — | — | Joe Abercrombie | joe@example.com | ✗ | B1 | 813.0 g | ✗ | 2024-02-04 | ||
| The Dispossessed Door 103 | Fiction | 30.10 € | Ace | Ace | 1952-01-01 | Iain Banks, Frank Herbert | iain@example.com, frank@example.com | ✗ | Reserve | 738.0 g | ✗ | 2023-09-26 | ||
| The Ancient Archive 119 | Fiction | 21.49 € | DAW | DAW | 1971-01-01 | Octavia Butler, Mary Shelley | octavia@example.com, mary@example.com | ✗ | A2 | 559.0 g | ✗ | 2026-10-26 | ||