Books by Orbit

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 :catalog). 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: :catalog %>   <%# search, filters, sort, actions %>
<%= crud_filter   @books, fieldset: :catalog %>   <%# filter sidebar (the model, or the list's scope) %>

Read more: Fields & cells  ·  Views & fieldsets

Reset
Cover Title Subtitle Author names Genre Price Pages Published on Publisher Reviews Active Manual Created at
Reset
The Ancient Garden 43 — Frank Herbert, Iain Banks, and Becky Chambers Fiction 42.67 € 276 1957-05-15 Orbit — ✓ — 05 Oct 14:41
The Distant Engine 46 — Margaret Atwood and Ted Chiang Fiction 21.25 € 505 1956-02-27 Orbit Linus on The Distant Engine 46 ✓ — 05 Oct 14:41
The Broken Empire 48 — Ted Chiang and Ann Leckie Fiction 30.49 € 232 1987-03-04 Orbit Alan on The Broken Empire 48, Edsger on The Broken Empire 48, Ada on The Broken Empire 48 ✗ — 05 Oct 14:41
The Distant Station 86 — Frank Herbert and Mary Shelley Fiction 12.86 € 453 2017-05-20 Orbit — ✓ — 05 Oct 14:41
Filter
Cover
Title
Subtitle
Author names
Genre
Price
Pages
Published on
Publisher
Active
Manual
Created at
Blurb
Reset