This commit is contained in:
9
app/javascript/helpers/form_helpers.js
Normal file
9
app/javascript/helpers/form_helpers.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import { FetchRequest } from "@rails/request.js"
|
||||
|
||||
export async function submitForm(form) {
|
||||
const request = new FetchRequest(form.method, form.action, {
|
||||
body: new FormData(form)
|
||||
})
|
||||
|
||||
return await request.perform()
|
||||
}
|
||||
Reference in New Issue
Block a user