Live reviews

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

The gem gives every row a dom_id, so a Turbo morph refresh updates only changed rows (no flicker, scroll preserved). This demo fakes the trigger with a 2-second JS poll; in production you'd drop the poll, add broadcasts_refreshes to the model and turbo_stream_from here — the markup the gem emits already satisfies it. Click the button (or add a review in a second tab) and watch a row morph in.

app/models/review.rb
broadcasts_refreshes   # production: push a refresh when a review changes
app/views/live/index.html.erb
<%= turbo_stream_from :reviews %>            <%# production: subscribe to live updates %>
<%= crud_collection @reviews, query: :static %>

Read more: Turbo Streams

Book Reviewer name Rating Body Created at
The Silent Station 120 Linus ★★★☆☆ The world-building is superb. Could not put it down. 05 Oct 11:31
The Silent Station 120 Radia ★★☆☆☆ Slow start, great finish. 05 Oct 11:31
The Ancient Archive 119 Radia ★★★★★ Read it twice already. 05 Oct 11:31
The Ancient Archive 119 Radia ★★☆☆☆ Slow start, great finish. Could not put it down. 05 Oct 11:31
The Ancient Archive 119 Ada ★★☆☆☆ The world-building is superb. Not my cup of tea. 05 Oct 11:31
The Ancient Archive 119 Grace ★★★☆☆ Slow start, great finish. The world-building is superb. 05 Oct 11:31
The Burning Empire 118 Ada ★★★★★ Slow start, great finish. 05 Oct 11:31
The Burning Empire 118 Ada ★☆☆☆☆ Slow start, great finish. 05 Oct 11:31