daijinara said over 1 year ago on Embedding Youtube Videos into Action Text with Stimulus :
If anyone is interested in using request.js instead of ujs, then
async attachContent(content) {
        let _this = this
        let formData = new FormData()
        formData.append("content", content)
        const response = await patch('/embed', { body: formData, responseKind: "json" })
        if (response.ok) {
            const data = response.json
            data.then((result) => {
                const attachment = new Trix.Attachment(result)
                _this.element.editor.insertAttachment(attachment)
                _this.element.editor.insertLineBreak()
            })
        }
    }

However, Rails 7 & turbo-rails ver. >=1.1.0 does not display ActionText attachments. It's really ugly but below is what I did while I am waiting for its upgrade. 
<% post.content.body.attachables.each do |node| %>
    <%= render partial: 'embeds/embed', locals: { embed: Embed.new(id: node.id) } %>
<% end %>