Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
turbo
The speed of a single-page web application without having to write any JavaScript (by hotwired)
Although Redis is not technically required in development for CableReady, we’ll use it and hiredis to match the installation guidance from CableReady.
Today we explored how to add CableReady and Stimulus onto the core Rails ActionCable package to enable real-time DOM manipulations without writing tons of JavaScript, worrying about client-side state management, or doing much outside of writing pretty standard Rails code. The complete source code for this demo application is on Github.
Although Hotwire's Turbo library garnered a lot of attention, the Rails community has been working for years to improve the toolset we have to build modern, full-stack Rails applications. Turbo isn't the first attempt at giving Rails developers the tools they need.
Today we're going to explore CableReady by using Rails, CableReady, and Stimulus to build a scoreboard that updates for viewers in real-time, with just a few lines of Ruby and JavaScript.
Read the Hotwire documentation
One of the most important of these projects is CableReady, which powers StimulusReflex and Optimism, along with standing on its own as a tool to:
Related posts
- Rails, Hotwire, CableReady, and StimulusReflex are BFFs
- Sort tables (almost) instantly with Ruby on Rails and Turbo Frames
- Server-rendered modal forms on Rails with CableReady, Mrujs, Stimulus, and Tailwind
- Am I Principal Skinner? Complexity of front-end is just baffling to me now
- Frontend, backend - let's be friends again