How Turbo 8 Morphing Makes Rails Frontend Development Feel Like Magic

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

Turbo 8 introduced Page Morphing, which eliminates the need to write manual Turbo Stream files in Rails apps. Using the idiomorph library under the hood, it diffs the new HTML against the current DOM and updates only what changed — without page blinks, scroll jumps, or lost input state. Setup requires just one meta tag helper in the layout, after which controllers can go back to simple redirects. For real-time updates, adding `broadcasts_refreshes` to an ActiveRecord model triggers WebSocket-based page refreshes automatically when data changes, achieving full reactivity with a single line of Ruby.

5m read timeFrom norvilis.com
Post cover image
Table of contents
The Problem with Turbo StreamsWhat is Page Morphing?STEP 1: Enabling MorphingSTEP 2: Simplifying the ControllerSTEP 3: Real-Time Magic ( broadcasts_refreshes )Summary

Sort: