Books by Mary Shelley

How this page is built the gem renders it — this is all you write

A full table — search, an inline filter row, sortable columns and row actions — all derived from the model. This page toggles between the curated :index and the fuller :catalog fieldset (currently :index). Your controller assigns @books — scope it for authorization (e.g. Book.accessible_by(current_ability)) and the gem renders that scope.

app/models/book.rb
crud_structure do
  attribute :price, as: :number, unit: '€', digits: 2
  fieldset :index,   %i[cover title author_names genre price publisher active]
  fieldset :catalog, %i[cover title subtitle author_names genre price purchase_price
                        shop_margin pages published_on publisher reviews active manual created_at]
end
app/views/books/index.html.erb
<%= crud_collection @books, fieldset: :index %>   <%# search, filters, sort, actions %>
<%= crud_filter   @books, fieldset: :index %>   <%# filter sidebar (the model, or the list's scope) %>

Read more: Fields & cells  ·  Views & fieldsets

Cover Title Author names Genre Price Publisher Active
The Endless Mirror 2 Ann Leckie, Mary Shelley, and Ursula Le Guin Nonfiction 28.63 € Vintage ✓
The Endless Dune 17 Joe Abercrombie, Mary Shelley, and Stanisław Lem Fiction 18.69 € Tor Books ✓
The Hidden Archive 22 Becky Chambers, Mary Shelley, and Frank Herbert Fiction 23.21 € — ✓
The Ancient Mirror 24 Mary Shelley Fiction 33.42 € Gollancz ✓
The Hidden Engine 31 Becky Chambers, Mary Shelley, and Stanisław Lem Fiction 32.85 € Vintage ✓
The Silent Tower 39 Ann Leckie, Mary Shelley, and Ursula Le Guin Nonfiction 25.60 € Baen ✓
The Broken Dune 49 Margaret Atwood and Mary Shelley Scifi 22.90 € Vintage ✓
The Quiet Dune 62 Mary Shelley Nonfiction 24.14 € Vintage ✗
The Ancient Dune 67 Mary Shelley and Ann Leckie Fiction 38.41 € Tor Books ✓
The Luminous Engine 76 Mary Shelley Fiction 34.79 € Ace ✓
The Distant Station 86 Frank Herbert and Mary Shelley Fiction 12.86 € Orbit ✓
The Luminous Station 94 Adrian Tchaikovsky and Mary Shelley Fiction 26.90 € Vintage ✓
The Hidden Door 106 Martha Wells, Mary Shelley, and Stanisław Lem Nonfiction 19.30 € Orbit ✓
The Hidden Door 107 Iain Banks and Mary Shelley Scifi 17.84 € — ✓
The Burning Station 110 Mary Shelley Nonfiction 24.38 € Baen ✓
The Burning Empire 118 Kim Robinson, Mary Shelley, and Margaret Atwood Fiction 17.01 € DAW ✗
The Ancient Archive 119 Octavia Butler and Mary Shelley Fiction 21.49 € DAW ✗
The Silent Station 120 Martha Wells, Becky Chambers, and Mary Shelley Scifi 42.11 € DAW ✓
Filter
Cover
Title
Author names
Genre
Price
Publisher
Active
Reset