Sha256: 948634adb1c42e1da73925164e9db986aa4929e13a8db2b69ad7027365fe5666
Contents?: true
Size: 971 Bytes
Versions: 1
Compression:
Stored size: 971 Bytes
Contents
<template> <Head title="Editing <%= human_name.downcase %>" /> <h1>Editing <%= human_name.downcase %></h1> <Form :<%= singular_table_name %>="<%= singular_table_name %>" submitText="Update <%= human_name %>" @onSubmit="handleSubmit" /> <br /> <div> <Link :href="`<%= js_resource_path %>`">Show this <%= human_name.downcase %></Link> | <Link href="<%= js_resources_path %>">Back to <%= human_name.pluralize.downcase %></Link> </div> </template> <script setup> import { Head, Link } from '@inertiajs/vue3' import Form from './Form.vue' const { <%= singular_table_name %> } = defineProps(['<%= singular_table_name %>']) const handleSubmit = (form) => { form.transform((data) => ({ <%= singular_table_name %>: data })) <% if attributes.any?(&:attachments?) -%> form.post(`<%= js_resource_path %>`, { headers: { 'X-HTTP-METHOD-OVERRIDE': 'put' }, }) <% else -%> form.patch(`<%= js_resource_path %>`) <% end -%> } </script>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
inertia_rails-3.5.0 | lib/generators/inertia_templates/scaffold/templates/vue/Edit.vue.tt |