Sha256: 0efa79c7d557c28d8b203080fc9071009266b889e7ce2c6867783c70de3ba4d2
Contents?: true
Size: 1.3 KB
Versions: 5
Compression:
Stored size: 1.3 KB
Contents
import { Link, Head } from '@inertiajs/react' import Form from './Form' export default function Edit({ <%= singular_table_name %> }) { return ( <> <Head title="Editing <%= human_name.downcase %>" /> <div className="mx-auto md:w-2/3 w-full px-8 pt-8"> <h1 className="font-bold text-4xl">Editing <%= human_name.downcase %></h1> <Form <%= singular_table_name %>={<%= singular_table_name %>} onSubmit={(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 -%> }} submitText="Update <%= human_name.downcase %>" /> <Link href={`<%= js_resource_path %>`} className="ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" > Show this <%= human_name.downcase %> </Link> <Link href="<%= js_resources_path %>" className="ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" > Back to <%= human_name.pluralize.downcase %> </Link> </div> </> ) }
Version data entries
5 entries across 5 versions & 1 rubygems