Turbo & Hotwire Patterns

Implement Turbo and Stimulus patterns for real-time Rails UI updates.

10|1|Updated Dec 20, 2025
One-click install
npx skills add https://github.com/Kaakati/rails-enterprise-dev --skill turbo-hotwire-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Turbo & Hotwire Patterns
Source: https://github.com/Kaakati/rails-enterprise-dev/tree/main/plugins/rails-enterprise-dev/skills/hotwire-patterns
Command: npx skills add https://github.com/Kaakati/rails-enterprise-dev --skill turbo-hotwire-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides comprehensive guidance for implementing Hotwire (Turbo + Stimulus) in Ruby on Rails applications to enable real-time updates and reduced JavaScript.

Core Features & Use Cases

  • Hotwire Stack Overview: Turbo Drive, Turbo Frames, Turbo Streams, and Stimulus controllers.
  • Turbo Drive: Convert links and forms into AJAX requests for smooth navigation.
  • Turbo Frames & Streams: Partial updates and real-time DOM changes.
  • Stimulus: Lightweight client-side controllers to augment server-rendered HTML.

Quick Start

Add the turbo-rails and stimulus-rails gems, run bundle install, and begin attaching Turbo frames and streams to components; build a simple live-updating list.

Frequently Asked Questions about Turbo & Hotwire Patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add real-time updates to a Rails application without writing a lot of JavaScript?

Hotwire—combining Turbo and Stimulus—enables real-time UI updates in Rails with server-rendered HTML. Turbo Streams push DOM changes to browsers, while Stimulus adds lightweight client-side behavior, reducing custom JavaScript and keeping logic on the server.

What's the difference between Turbo Frames and Turbo Streams?

Turbo Frames replace sections of a page on user interaction (clicks, form submissions), while Turbo Streams broadcast DOM changes to multiple clients in real-time. Use Frames for user-initiated updates and Streams for live data synchronization.

Can I use Hotwire to handle partial page rendering and live data streams?

Yes. Turbo Frames handle partial page rendering on navigation and form submission, while Turbo Streams deliver real-time DOM mutations to update live data. Stimulus controllers augment both with lightweight interactivity.

Do I need to replace my existing Rails forms and links to use Turbo?

No. Turbo Drive automatically converts standard links and forms into AJAX requests for smooth navigation. Add `turbo-rails` gem and existing markup works; opt out specific links or forms with data attributes if needed.

What are the limitations of Hotwire for complex interactive features?

Stimulus controllers handle lightweight behavior well, but highly complex state management or advanced animations may benefit from a JavaScript framework. Hotwire excels for server-centric Rails apps; evaluate if your UX needs justify a heavier client-side approach.

How do Stimulus controllers work with server-rendered HTML in Rails?

Stimulus controllers attach to HTML elements via data attributes, managing DOM interactions and state without a build step. They integrate seamlessly with server-rendered views, letting Rails handle data and Stimulus handle progressive enhancement.