June 2025
Intermediate to advanced
488 pages
12h 27m
English
As we saw with the products index page in Iteration A3: Making the Page Update in Real Time, it’s possible to send information from our Rails app to our users’ browsers without a direct request. The technology that enables this is called WebSockets.[61] Prior to Rails 5, setting this up was fairly involved, but Rails 5 introduced Action Cable, which simplifies pushing data to all connected browsers.
We can use Action Cable and WebSockets to broadcast price updates to the users browsing the catalog. To see why we’d want to, bring up the Depot application in two browser windows or tabs. In the first window, display the catalog. Then, in the second window, update the price of an item. Return ...
Read now
Unlock full access