Books by Liu Cixin

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 Quiet Mirror 5 Kim Robinson, Liu Cixin, and Becky Chambers Nonfiction 32.73 € Del Rey ✓
The Dispossessed City 7 Liu Cixin, Octavia Butler, and Kim Robinson Fiction 17.82 € Vintage ✓
The Distant City 10 Stanisław Lem, Ted Chiang, and Liu Cixin Scifi 26.91 € DAW ✓
The Endless Forest 15 Octavia Butler, Ann Leckie, and Liu Cixin Scifi 11.84 € Del Rey ✓
The Distant Door 26 Ann Leckie, Iain Banks, and Liu Cixin Nonfiction 16.40 € Gollancz ✓
The Endless Winter 28 Iain Banks, Liu Cixin, and Ted Chiang Fiction 29.97 € Tor Books ✓
The Quiet Empire 59 Kim Robinson, Liu Cixin, and Ted Chiang Fiction 39.87 € Vintage ✓
The Distant Tower 63 Iain Banks, Liu Cixin, and Joe Abercrombie Scifi 18.55 € Baen ✓
The Dispossessed Forest 64 Liu Cixin Fiction 36.11 € — ✓
The Luminous Forest 68 Liu Cixin, Ann Leckie, and Ursula Le Guin Nonfiction 40.60 € Baen ✓
The Burning Forest 81 Ted Chiang, Becky Chambers, and Liu Cixin Nonfiction 6.28 € Del Rey ✓
The Distant Engine 83 Martha Wells, Liu Cixin, and Ursula Le Guin Scifi 39.52 € Del Rey ✓
The Luminous City 85 Liu Cixin, Stanisław Lem, and Iain Banks Nonfiction 22.63 € DAW ✓
The Luminous Tower 88 Frank Herbert, Liu Cixin, and Ursula Le Guin Nonfiction 37.25 € Ace ✓
The Ancient Forest 93 Liu Cixin and Kim Robinson Fiction 41.21 € DAW ✓
The Endless Ocean 105 Liu Cixin and Kim Robinson Scifi 34.90 € Baen ✓
Filter
Cover
Title
Author names
Genre
Price
Publisher
Active
Reset