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
Scanmodel with attributes. - You have a
ScanController#showaction. - A user is viewing a
Scanthrough theshow.html.slim|haml|erbview template.