Understanding Turbo in Rails: Drive, Frames & Streams
A complete breakdown of Turbo’s core features - Drive, Frames, and Streams. Learn how to build interactive Rails apps with minimal JavaScript using Hotwire.

Saikat Kumar Dey
Technical Consultant

Modern web apps aim for rich interactivity without compromising speed. Traditionally, this meant using JavaScript-heavy frameworks like React or Vue. But if you're a Ruby on Rails developer, there's good news: Hotwire, especially its core library Turbo, gives you SPA-like interactivity without writing much JavaScript. It’s fast, clean, and very “Railsy.”
Let’s look at the three pillars of Turbo in Ruby on Rails: Turbo Drive, Turbo Frames, and Turbo Streams and dive into what they are, how they work, and when to use them.
What is Turbo?
Turbo is part of Hotwire, a set of tools introduced by Basecamp (the creators of Rails) to build fast, dynamic applications using server-generated HTML.
Rails Turbo Has Three Main Components:
Turbo Drive: Navigation on Steroids
Turbo Drive automatically intercepts <a> and <form> submissions and fetches them via fetch (XHR) instead of letting the browser do a full-page reload.
What It Does:
- Updates the <body> and the <title> only.
- Keeps the layout and JavaScript context intact.
- Makes navigation feel instant.
Pros:
- Faster page transitions.
- Fewer network resources used.
- No need to manage JS frameworks for SPA-like routing.
Caveats:
- JS events may need reinitialization.
- Scripts inside <body> may not re-execute unless handled manually.
Enable It:
Turbo Drive is enabled by default when you use the Turbo gem:
In your <application.js>
Example:
You don’t need to change anything — Turbo Drive does the magic behind the scenes.
Turbo Frames: Seamless In-Page Updates
Turbo Frames are like little viewports on your page that can be independently updated without reloading the whole page.
What It Does:
- Targets a specific part of the DOM.
- Only that frame is replaced when a link/form inside it is activated.
Use Cases:
- Modals
- Sidebars
- Inline editing (like editing a post title in place).
Example:
The edit_post_patch view should also be wrapped in the same Turbo Frame:
Result? The title changes inline, and only that section reloads.
Turbo Streams: Real-Time Magic
Turbo Streams enable real-time updates to parts of your page using server-generated HTML over WebSockets or polling.
What It Does:
- Uses Actioncable to push updates.
- Works with standard CRUD actions (create/update/destroy).
- Updates the DOM using HTML-based messages
Actions You Can Perform:
Example:
In your model view, create a stream:
In your controller:
Then, create a create.turbo_stream.erb file:
When a new post is created, it will automatically appear at the top of the list for all connected users.
Turbo Drive, Turbo Streams and Turbo Frames: How These Three Work Together
Here’s a practical scenario:
- User visits posts index – Turbo Drive loads the page.
- User clicks “Edit” on a post – Turbo Frame swaps just that post area with the form.
- User submits the form – Turbo Frame reloads that section only.
- Another user adds a post – Turbo Stream pushes it to the first user’s page instantly.
Minimal JS. Maximum speed.
When Not to Use Turbo
- Highly interactive frontends needing client-side state management.
- Complex JavaScript widgets that don’t reinitialize easily.
- Third-party libraries not designed for Turbo’s lifecycle.
In such cases, consider stimulus.js or go full SPA.
Tips for Turbo Debugging
- Use Chrome DevTools → Network tab → Filter by “fetch”.
- Use data-turbo="false" to opt-out.
- Use Turbo.session.drive = false to disable globally (not recommended for production).
Turbo in Rails: A Smarter Way to Build Apps
Turbo gives Rails developers a refreshing middle-ground—fast, interactive UIs without diving into SPA frameworks. With Turbo Drive, Turbo Frames, and Turbo Streams, you get:
- SPA-like navigation.
- Seamless in-page updates.
- Real-time broadcasting.
All while sticking to server-rendered HTML, the classic Rails way.
From Rails upgrades to custom software development, RailsFactory brings 19+ years of hands-on Ruby on Rails experience.
Whether you need support for your RoR projects or extra hands to bring Turbo’s speed and interactivity to your app, we’re here to help.