Hello World

Minimum Viable CableReady

One of the most powerful aspects of CableReady is that it can be called from any part of your Rails application. Thanks to the new stream_from feature in CableReady v5, you can use it without any client configuration.

Drop a stream_from helper into your view whenever you need a Reactive UX:

<%= stream_from :foo %>
What does the agnostic, dyslexic insomniac do?

Everyone looking at this page - or any other page which is subscribed to :foo - will instantly see an update when the following Ruby executes:

cable_ready[:foo]
.append("body", html: "They lay awake, wondering if there is a dog.")
.broadcast

Your server-side code just dynamically updated text on potentially thousands of clients, without writing any boilerplate JavaScript or Ruby.

Jazz Hands

You could, in theory at least, already be done learning CableReady and just start using its 36 operations in your controllers, models, Reflexes and jobs. What a time to be alive! ✨

However, most developers will want to keep reading and learn how to use Channels.