Frameworks & Languages
Hotwire and Turbo in Rails: Interactive Pages Without a JavaScript Framework
Hotwire lets a Rails application deliver fast, interactive pages with server-rendered HTML instead of a separate single-page app. Here is what Turbo and Stimulus do, where they fit, where they do not, and the pitfalls to avoid.

Many business applications end up with two codebases: a Rails API and a separate React or Vue front end that has to be built, deployed and kept in step with it. For a dashboard, an admin area or a customer portal, that second application often adds more cost than it removes. Users want pages that update without full reloads, inline editing and live notifications, but they rarely need a full single-page application to get them.
That is the gap Hotwire fills, and it is now the default way we build interfaces in our Ruby on Rails development projects. This article explains what each part of Hotwire does, where it works well, and the pitfalls that catch teams new to it.
What Hotwire Actually Is
Hotwire is an approach rather than a framework: the server renders HTML, and a small amount of JavaScript swaps that HTML into the page. It has shipped with new Rails applications since Rails 7, and Rails 8 continues the same defaults. It has three main parts:
- Turbo Drive intercepts links and form submissions, fetches the next page in the background and replaces the body, so navigation feels instant without a full browser reload.
- Turbo Frames mark a region of a page, such as a row, a panel or a modal, that can be loaded or replaced on its own. A link inside a frame updates only that frame.
- Turbo Streams deliver small instructions such as append, prepend, replace or remove, each carrying a fragment of HTML. They can come back in the response to a form submission or be pushed over a WebSocket to everyone watching a page.
Alongside Turbo sits Stimulus, a modest JavaScript framework for behaviour that genuinely belongs in the browser: toggles, copy-to-clipboard, character counters, date pickers. Stimulus controllers attach to HTML through data attributes, so they keep working when Turbo replaces parts of the page.
Turbo 8 added page refreshes with morphing: instead of building a stream for every change, the server can tell the page to refresh, and Turbo updates only the elements that differ while keeping scroll position. For many screens this removes most of the hand-written stream code.
What It Looks Like in Practice
A typical example is an orders screen with inline editing. The list is ordinary server-rendered HTML. Each row is wrapped in a Turbo Frame, so clicking Edit loads a form into that row only. Submitting the form returns the updated row, or the form again with validation errors, and nothing else on the page moves. If another user changes an order, the model broadcasts a Turbo Stream and the row updates on everyone's screen.
All of that is written in Rails controllers, partials and a few lines of model configuration. There is no client-side state store, no JSON API to version, and no second build pipeline. Validation, permissions and formatting live in one place, which is the main reason Hotwire projects tend to be smaller and cheaper to maintain than the equivalent API plus SPA.
Where Hotwire Fits Well
- Admin panels and back-office tools built around lists, forms, filters and detail views.
- Customer portals and SaaS dashboards where most interaction is reading and updating records.
- Live updates such as notifications, status changes, comments and activity feeds, using Turbo Stream broadcasts over Action Cable. Rails 8 can run these on the database-backed Solid Cable adapter, so a separate Redis server is not mandatory for modest traffic.
- Mobile apps that are mostly screens of content, where Hotwire Native wraps the same server-rendered pages in iOS and Android shells and native screens are added only where they matter.
Where a JavaScript Framework Still Makes Sense
Hotwire is not the right tool for everything. We still reach for a component framework, or a React island mounted from a Stimulus controller, when the interface involves:
- Heavy client-side state, such as a spreadsheet-style grid, a drag-and-drop planner or a design canvas.
- Offline use, where the browser must keep working without a server round trip.
- Very latency-sensitive interactions where waiting for the server on every keystroke would feel slow.
- A public API that several clients consume anyway, which changes the cost balance.
Mixing is fine. A mostly Hotwire application with one rich React component is often the best of both, and our front-end development team works across both styles.
Common Pitfalls
- Wrong status codes on forms. When validation fails, the controller must render the form with a 422 status, or Turbo will not display the errors. After a successful submission, redirect; for deletes, use a 303 See Other redirect so the browser follows it with a GET request.
- Scripts that expect full page loads. Third-party widgets that initialise on
DOMContentLoadedrun once and then stop working after Turbo navigation. Wrap them in Stimulus controllers so they connect and disconnect as elements appear. - Mismatched frame IDs. A frame only updates if the response contains a frame with the same ID. Otherwise Turbo reports missing content. Links that should leave the frame need
data-turbo-frame="_top". - Broadcasts and permissions. Broadcast partials are rendered outside a request, without a current user. Keep them free of user-specific content, subscribe through signed stream names, and scope streams so users only receive records they may see.
- Too many broadcasts. Broadcasting every change to every subscriber can overload a busy page. Debounce where possible, use page refreshes for complex screens, and move broadcasts to background jobs.
Adding Hotwire to an Existing Rails Application
Older Rails applications built with Rails UJS, Turbolinks or jQuery can adopt Hotwire gradually. Turbo Drive can be enabled and then disabled on specific pages that are not yet ready, and Frames can be introduced one screen at a time. On very old versions, it is usually better to bring the framework up to date first, as we describe in upgrading an old Ruby on Rails application safely. For the wider question of whether Rails suits a new product, see is Ruby on Rails still a good choice.
Because Hotwire sends HTML rather than large JavaScript bundles, it also tends to help page weight and interaction times, which supports the work we do on website speed optimisation.
Talk to Us
If you are planning a Rails application, or maintaining one with a separate front end that has become expensive to keep in step, tell us what the interface needs to do and we will tell you honestly whether Hotwire will cover it.
Frequently Asked Questions
Is Hotwire only for new Rails applications?
No. It can be added to an existing Rails application gradually, enabling Turbo Drive across the site and turning it off on pages that are not ready, then introducing Frames and Streams screen by screen. Very old applications usually benefit from a framework upgrade first so the current Turbo and Stimulus packages work cleanly.
Will Hotwire make our application faster for users?
Usually it feels faster, because navigation avoids full page reloads and updates only the part of the page that changed, while shipping far less JavaScript than a typical single-page app. Real speed still depends on how quickly the server renders each response, so slow queries and heavy partials need attention as well.
Can we use Hotwire and React in the same application?
Yes, and it is a common pattern. Most screens use server-rendered HTML with Turbo, and a Stimulus controller mounts a React component for the one or two parts that need rich client-side state, such as a planner or an editable grid. Each tool does the job it is best at.
Does Hotwire work for mobile apps?
Hotwire Native lets iOS and Android apps display your existing Rails screens inside native navigation, with fully native screens added where they make a real difference, such as camera access or maps. It suits content and workflow apps well, while apps that are almost entirely custom native interfaces are better built natively or with a cross-platform toolkit.
Do we need Redis to use live updates with Turbo Streams?
Not necessarily. Rails 8 introduced Solid Cable, which uses the database to back Action Cable, and it is sufficient for many business applications. Redis remains a good choice when there are many concurrent connections or a high volume of broadcasts, and we size this based on expected traffic.





