Hi,
I have been looking for a best practice to handle this kind of things, did not found…
I have a list of tasks that are visible to everyone, but “doable” only by some users. To differentiate visually the tasks, the not doable one are striped.
When a task is changed, I need to broadcast the change to everyone. I removed every occurrence of current_user
in the task partial so the broadcast work. But I still need to add the stripe on the undoable task.
I was going to add the ids of the user that can do the task in a data attribute, and then check by javascript if the current user id (given in a meta tag) is included in this list. If not, add the stripe.
Is it a good solution ? Is there anything better to do ?
Thank you for any tips
PS: Pardon my english, I am french.
PS: Hotwire is incredible