Action Text comment form that works inside a Turbo Frame

13426
0

Action Text is great, but you need to be deliberate about how you render it in a Turbo-powered UI. I keep the comment form inside a turbo_frame_tag so it can be replaced on validation errors (still 422). On success, I clear the form by replacing the frame with a fresh form partial, and I prepend the rendered comment to the list. The controller doesn’t have to know about the editor details; it’s still a normal comment_params permitting :body. One thing I watch for is loading Trix assets correctly (importmap or bundler). Once it’s set up, this approach gives you rich text with minimal custom JS.