Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Use Turbo in your Ruby on Rails app
Turbo Rails is the official Ruby gem that brings Hotwire's Turbo to Rails applications, giving server-rendered HTML the speed of a single-page app without requiring custom JavaScript.
Turbo Rails is the Ruby gem integration for the Turbo JavaScript framework, maintained under the Hotwire project. It takes standard Rails server-generated HTML — links, forms, and page components — and accelerates them via Turbo Drive, Turbo Frames, and Turbo Streams. The gem provides view helpers and backend machinery that plug into Rails 7+ automatically or Rails 6 via manual install.
Turbo Rails packages Hotwire's three core techniques — Drive, Frames, and Streams — plus Rails helpers, native bridges, and test tooling.
turbo_frame_tag so that links and form submissions inside it replace only that frame; frames can be lazy-loaded automatically.turbo_frame_tag, turbo_stream_from, a Turbo::Broadcastable concern, and a custom layout method for frame requests.Turbo::TestAssertions, Turbo::Broadcastable::TestHelper, and system test helpers like connect_turbo_cable_stream_sources to wait for cable connections.Turbo Rails suits developers who want SPA performance from server-rendered Rails apps.
These are the typical tasks the gem handles inside a Rails app.
turbo_stream_from and model callbacks to push HTML changes to subscribed clients over WebSockets.Turbo Rails works by installing a JavaScript runtime that intercepts navigation, plus Rails helpers that generate the needed HTML tags. Add the gem with gem 'turbo-rails', run bundle install, then run bin/rails turbo:install. For Rails 7+ apps, it's automatically configured unless --skip-hotwire is passed. In development, Turbo uses the single-process async Action Cable adapter, so broadcasts only reach the same process; use the web console to trigger them manually.
Yes, Turbo is released under the MIT License.
Yes. Rails 6 applications need the manual install: add the gem to your Gemfile, run ./bin/bundle install, and then run ./bin/rails turbo:install.
Turbo Drive is the continuation of the Turbolinks framework. It adds interception of form submissions and their responses, so the entire navigation flow works without data-remote=true.
For the core features, no. Turbo Drive, Frames, and Streams rely on server-generated HTML. The few dynamic bits left can be handled with Stimulus if needed.
