How Do I send a "Turbo Hotwire Broadcast" only when a record with a specific name value is created or updated, and for a specific partial?
Hello, you have a great community in Gorails. I have a Rails View with 3 numerical integer indicators: speed, temperature and pressure.
These values are stored in SavedObject model as serialized objects. And in the controller are passed to the view with their respective instance variables. @speed @temperature @pressure
The question
How can I send a separate broadcast (with turbo hotwire) for each serialized object conditioned by the "name" column (like "Device 2 Temperature") , when this is updated, so each broadcast reach to their own partial? (there are three different partials in the same view)
This is the model
class SavedObject < ApplicationRecord
serialize :value
end
These are the columns.
t.string :name
t.text :value
Record Example
id: 144,
name: "Device 2 Temperature",
value: [{last_value: "52", equip_id: 2}]```