Hidden feature of Turbo: stream actions inside regular HTML | Radan Skorić's personal site
18-May-2024 540
Turbo stream actions are a central feature of Turbo, allowing for control of the webpage from server side. In essence, turbo stream actions are a piece of custom HTML markup that Turbo has a special way of interpreting as an action to execute rather than as content to be rendered.Here’s what the official documentation has to say about when they can be used:You can render any number of stream elements in a single stream message from a WebSocket, SSE or in response to a form submission.Turbo knows to automatically attach elements when they arrive in response to submissions that declare a MIME type of text/vnd.turbo-stream.html.Quickly, without checking, answer this: will a stream action work if it is just inserted inside a plain HTML response? In other words, if I render a page and simply include a turbo stream tag somewhere in the middle of it, will the associated action be executed?.
Hidden feature of Turbo: stream actions inside regular HTML | Radan Skorić's personal site #ruby #rubydeveloper #rubyonrails #Hidden #feature #Turbo: #stream #actions #inside #regular #Radan #Skorić's #personal #turbo: https://rubyonrails.ba/link/hidden-feature-of-turbo-stream-actions-inside-regular-html-radan-skoric-s-personal-site