rails-broadcasting

Broadcast real-time UI updates in Rails apps via Turbo Streams and Action Cable.

4|2|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/rubakas/agent-notes --skill rails-broadcasting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-broadcasting
Source: https://github.com/rubakas/agent-notes/tree/main/rails-broadcasting
Command: npx skills add https://github.com/rubakas/agent-notes --skill rails-broadcasting

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Turbo Streams and Action Cable enable real-time UI updates in Rails apps, eliminating stale views and manual refreshes when data changes.

Core Features & Use Cases

  • Automatic model broadcasting with broadcasts_refreshes to push updates on changes
  • Morph-based updates with broadcast_morph_to to preserve form state and scroll position
  • Flexible targeting: instance-based, collection-based, nested streams, and user-specific channels
  • Comprehensive methods: append, prepend, replace, update, remove, morph
  • Performance considerations: conditional broadcasting, debouncing, and background jobs via Active Job
  • Action Cable as the WebSocket backbone for live collaboration and notifications

Quick Start

Include @agent-notes/rails/index.md in your CLAUDE.md to enable Rails broadcasting patterns.

Frequently Asked Questions about rails-broadcasting

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

FAQPage Schema
How do I broadcast real-time UI updates in Rails without manual page refreshes?

You broadcast real-time UI updates in Rails using Turbo Streams and Action Cable to push DOM changes over WebSockets. This eliminates stale views by reflecting data modifications instantly across instance, collection, nested, and user-scoped channels.

Can I preserve form state and scroll position when broadcasting updates with Turbo Streams?

You can preserve form state and scroll position during Turbo Streams broadcasting by using morph-based updates. The broadcast_morph_to method intelligently updates only changed DOM elements rather than replacing the entire view structure.

Does this support broadcasting Rails model changes in background jobs?

It supports broadcasting Rails model changes within background jobs via Active Job. This allows performance optimizations like conditional broadcasting, debouncing updates, and offloading heavy real-time notifications from the main request cycle.

What Rails broadcasting methods are available for targeting specific users versus collections?

Available Rails broadcasting methods include append, prepend, replace, update, remove, and morph. These can target instance-based streams, collection-based streams, nested streams, and user-specific channels for flexible real-time UI delivery.

Do I need Action Cable and Turbo both set up to enable real-time broadcasting in Rails?

You need Rails with Turbo and Action Cable configured to enable real-time broadcasting. Action Cable serves as the WebSocket backbone for live updates, while Turbo Streams handles the DOM patching mechanism for UI synchronization.