This example will show how to push updates to the view for a Model instance that has changed without the user having to refresh the page.
This example focuses more on getting ActionCable working with Stimulus. If you don't already have stimulus setup in your app, here's a great write up on how to set it up: https://medium.com/better-programming/how-to-add-stimulus-js-to-a-rails-6-application-4201837785f9
- You have a
Scan
model with attributes. - You have a
ScanController#show
action. - A user is viewing a
Scan
through theshow.html.slim|haml|erb
view template.