Reviews

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

The rating column uses a custom renderer — one partial in your app (_stars.html.erb) named by as: :stars. Search delegates through :book into Book's own search_in (try a publisher name). Your controller assigns @reviews.

app/models/review.rb
crud_structure do
  search_in :reviewer_name, :body, :book   # :book delegates into Book's search_in
  attribute :rating, as: :stars            # → app/views/crud_components/fields/_stars.html.erb
  fieldset :index, %i[book reviewer_name rating body created_at]
end
app/views/reviews/index.html.erb
<%= crud_collection @reviews %>

Read more: Renderers  ·  The like-spec

Reset
Book Reviewer name Rating Body Created at
Reset
The Hidden Engine 13 Radia ★★★★ Read it twice already. 17 Aug 15:28
The Hidden Engine 13 Ada ★★★☆☆ The world-building is superb. Read it twice already. 17 Aug 15:28
The Hidden Engine 13 Linus ★★★★★ Not my cup of tea. Read it twice already. 17 Aug 15:28
The Hidden Engine 13 Grace ★★★★ Slow start, great finish. Not my cup of tea. 17 Aug 15:28