I just joined this community and this is my first post.
I’ve been following several Hotwire tutorials and have built some prototypes with the technology. I’ve been impressed with how easy it is to get SPA-like responsiveness with much less complexity compared to JS front end frameworks.
However, I’ve found that when I try to translate the code and process from my prototypes to my existing Rails project it simply never works. What’s worse is that I don’t know why.
I’ve tried to write some tracer code with the following general process:
- Include the Hotwire gem
- Install Hotwire via terminal command
- Include broadcasts from the relevant model
- Apply a turbo_stream_from tag as a listener at the view level
- Include a turbo_frame_tag where you want the model data to be updated
This works reliably in my prototypes, but won’t work in my existing project. I’m suspecting it may be because my existing project isn’t using the latest version of Rails nor Ruby? (Upgrading has not proved easy either.) I am currently using Ruby version 2.7.1 and Rails version 6.0.2.
I know I should be offering up some of my project code, but I don't even know where to begin. If anyone would be able to offer me some guidance I’d REALLY appreciate it. Thank you!
EDIT: If it helps at all these are the kinds of terminal messages I'm getting when attempting to get Hotwire to autoupdate a list of model instances on an index page. It seems like the broadcast is working but my listener isn't?