Books by Martha Wells

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 Dispossessed Station 12 Martha Wells and Ann Leckie Nonfiction 16.58 € Baen ✓
The Endless Station 13 Ann Leckie, Martha Wells, and Ursula Le Guin Fiction 27.05 € DAW ✗
The Endless Door 35 Martha Wells Nonfiction 24.06 € — ✓
The Hidden Station 44 Margaret Atwood, Martha Wells, and Becky Chambers Scifi 12.11 € Tor Books ✓
The Hidden Tower 47 Martha Wells Nonfiction 19.92 € Del Rey ✓
The Ancient Ocean 53 Martha Wells and Ursula Le Guin Fiction 25.74 € Del Rey ✓
The Broken Empire 58 Martha Wells Scifi 34.83 € Ace ✓
The Hidden Dune 79 Martha Wells and Ursula Le Guin Fiction 24.25 € Gollancz ✓
The Ancient Engine 80 Martha Wells and Kim Robinson Nonfiction 17.29 € — ✓
The Distant Engine 83 Martha Wells, Liu Cixin, and Ursula Le Guin Scifi 39.52 € Del Rey ✓
The Distant Winter 96 Martha Wells and Becky Chambers Fiction 10.36 € Gollancz ✓
The Endless Mirror 98 Adrian Tchaikovsky, Martha Wells, and Ann Leckie Nonfiction 33.32 € DAW ✓
The Hidden Door 106 Martha Wells, Mary Shelley, and Stanisław Lem Nonfiction 19.30 € Orbit ✓
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