Books by Ace

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

Reset
Cover Title Author names Genre Price Publisher Active
Reset
The Burning Tower 20 Ann Leckie Scifi 14.56 € Ace ✓
The Endless Winter 30 Octavia Butler Scifi 39.19 € Ace ✓
The Endless Signal 33 Adrian Tchaikovsky Fiction 39.74 € Ace ✓
The Distant Garden 34 Ted Chiang Nonfiction 25.55 € Ace ✓
The Burning Station 50 Ursula Le Guin and Octavia Butler Fiction 14.43 € Ace ✓
The Luminous City 57 Adrian Tchaikovsky, Frank Herbert, and Margaret Atwood Scifi 23.17 € Ace ✓
The Broken Empire 58 Martha Wells Scifi 34.83 € Ace ✓
The Luminous Engine 76 Mary Shelley Fiction 34.79 € Ace ✓
The Dispossessed Archive 82 Octavia Butler and Ted Chiang Scifi 35.72 € Ace ✓
The Luminous Tower 88 Frank Herbert, Liu Cixin, and Ursula Le Guin Nonfiction 37.25 € Ace ✓
The Hidden Tower 91 Adrian Tchaikovsky, Frank Herbert, and Kim Robinson Scifi 29.28 € Ace ✓
The Ancient Archive 114 Frank Herbert, Kim Robinson, and Margaret Atwood Nonfiction 44.21 € Ace ✓
Filter
Cover
Title
Author names
Genre
Price
Publisher
Active
Reset