The Hidden Engine 78

How this page is built the gem renders it — this is all you write

crud_record renders the record as a definition list with the same type-aware cells as the table. The column picker is reusable here too: crud_column_picker @book (the gear, top-right) submits ?cols= to this page, and crud_record @book, picked_columns: @visible narrows the list to match — same mechanism as the table, no JS to open. Below it, an embedded reviews collection is static (query: :static). The URL is the book's slug (identify_by :slug).

app/controllers/books_controller.rb
@visible = CrudComponents.selected_columns(params)   # the picker's ?cols=, for crud_record (persist it if you like)
app/views/books/show.html.erb
<%= crud_column_picker @book %>                                  <%# the gear, reusable outside a table %>
<%= crud_record @book, picked_columns: @visible %>  <%# honors the picker's selection %>

Read more: Record view  ·  Column picker

Edit in admin
Id
8,478
Title
The Hidden Engine 78
Subtitle
—
Slug
the-hidden-engine-78
Blurb

The Hidden Engine 78 — broken tales of the archive.

  • A story in 5 parts
  • Set in the Station
Price
8.00 €
Pages
422
Published on
1980-11-10
Active
✗
Genre
Scifi
Metadata
{
  "isbn": "978-347417167",
  "binding": "paperback"
}
Publisher
—
Created at
05 Oct 12:21
Updated at
05 Oct 12:21
Cover
Manual
—
Reviews
—
Chapters
1. Archive, 2. City, 3. Archive, 4. Engine
Stock
37 in stock
Comments
—
Authors
Iain Banks
Author names
Iain Banks

Reviews (static embedded collection — query: :static)

Book Reviewer name Rating Body Created at
No records