rails-action-cable

Installation
SKILL.md

Rails Action Cable

Architecture

  • Use one channel per resource domain (e.g., ChatChannel, RoomChannel)
  • Channels manage WebSocket subscriptions; streams represent broadcast sources
  • Use multiple stream_for or stream_from calls within one channel when needed
  • Use Solid Cable in production — the Rails 8 default DB-backed pub/sub adapter (no Redis required; ~1 day message retention)
  • Never use dynamic string interpolation in stream names without explicit authorization

Subscription Lifecycle

  • Always define both subscribed and unsubscribed methods
  • Call stream_for resource or stream_from "stream_name" inside subscribed
  • Call stop_all_streams in unsubscribed to clean up
  • Set current_user only in ApplicationCable::Connection#connect, not in channels

Security

Installs
2
First Seen
May 8, 2026
rails-action-cable — gierd-inc/dev-skills