March 2025
Intermediate to advanced
472 pages
12h 10m
English
Up until now, our users’ web browsers have requested information from our Rails app, either by going directly to a URL or by clicking a link or button. It’s also 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. ...
Read now
Unlock full access