I have a Rails 6 View with three 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 update, conditioned by the "name" column (like "Device 2 Temperature") , 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
#<SavedObject:0x000055a2f6f34fa0
id: 144,
name: "Device 2 Temperature",
value: [{last_value: "52", equip_id: 2}]