Sha256: da5b04419be59c51c0d351ee1365922e43ebaeaec2b6db09558716303baa9227
Contents?: true
Size: 739 Bytes
Versions: 30
Compression:
Stored size: 739 Bytes
Contents
import { Controller } from "@hotwired/stimulus" import { FetchRequest } from '@rails/request.js' /* attach to a form element to have it submit to a turbo-stream endpoint <form action="/contacts" data-controller="refine--turbo-stream-form" data-action="submit->refine--turbo-stream-form#submit"> Turbo is supposed to handle this natively but we're seeing issues when the form is inside an iframe */ export default class extends Controller { async submit(event) { event.preventDefault() const request = new FetchRequest( (this.element.method || "POST"), this.element.action, { responseKind: "turbo-stream", body: new FormData(this.element) } ) await request.perform() } }
Version data entries
30 entries across 30 versions & 1 rubygems