Books by Gollancz

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   Book, fieldset: :index %>     <%# filter sidebar (takes the model, not a scope) %>

Read more: Fields & cells  ·  Views & fieldsets

Cover Title Author names Genre Price Publisher Active
The Ancient Tower 11 Ted Chiang, Ann Leckie, and Frank Herbert Fiction 40.82 € Gollancz
The Quiet Station 12 Joe Abercrombie Scifi 11.40 € Gollancz
The Hidden Engine 13 Margaret Atwood and Frank Herbert Nonfiction 33.63 € Gollancz
The Endless Machine 14 Ann Leckie, Ursula Le Guin, and Joe Abercrombie Fiction 8.37 € Gollancz
The Burning Door 23 Ann Leckie and Martha Wells Fiction 15.15 € Gollancz
The Ancient City 52 Margaret Atwood Fiction 17.77 € Gollancz
The Ancient Tower 54 Margaret Atwood Nonfiction 27.65 € Gollancz
The Broken Door 55 Stanisław Lem and Ted Chiang Scifi 36.00 € Gollancz
The Dispossessed Tower 90 Mary Shelley and Liu Cixin Scifi 33.21 € Gollancz
The Ancient Winter 111 Ursula Le Guin Nonfiction 11.99 € Gollancz
The Endless Machine 117 Ted Chiang and Kim Robinson Scifi 14.47 € Gollancz
Filter
Title
Author names
Genre
Price
Publisher
Active
Reset