-
I have some partials that are broadcast thru action cable during model creation/update For example: Problem is that the partial is checking if the user is allowed to see a specific UI element
I am getting the following exceptions
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey!
It's almost impossible with Hotwire. The problem is that the Turbo Stream partial is rendered without any user context (it's rendered within a background job and once for all users). What you need is to render a partial per user. There are several ways of dealing with this problem (I call it the personalization problem, see this talk):
|
Beta Was this translation helpful? Give feedback.
Hey!
It's almost impossible with Hotwire. The problem is that the Turbo Stream partial is rendered without any user context (it's rendered within a background job and once for all users). What you need is to render a partial per user.
There are several ways of dealing with this problem (I call it the personalization problem, see this talk):
Enhance UI on the client-side via Stimulus (or similar); render controls hidden by defa…