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.
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
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.