invoke
Assignment
Assign any property value on the client.
Assign Dataset Values
We can assign pretty much assign any property value with TurboBoost Streams.
This is not a method call. Pay attention to the
=
sign that denotes an assignment.
Open the JavaScript console and inspect the
body
element.
<%= turbo_stream
.invoke("document.title =", args: ["invoke Assignment"])
.invoke("dataset.turboBoostAssignment =", args: [true], selector: "body")
.invoke("className =", args: ["text-red-500"], selector: "#assignment-demo-description")
.invoke("innerText =", args: ["innerText assigned by TurboBoost Streams invoke"],
selector: "#assignment-demo-description") %>