Sha256: b520f2e9cc7372460f0d3e0b7ffe0a0d99ef5318ea54c2af182f7d4a72e45f2f
Contents?: true
Size: 844 Bytes
Versions: 3
Compression:
Stored size: 844 Bytes
Contents
import { Head, Link } from '@inertiajs/react' import Form from './Form' import { <%= inertia_model_type %> } from './types' interface NewProps { <%= singular_table_name %>: <%= inertia_model_type %> } export default function New({ <%= singular_table_name %> }: NewProps) { return ( <> <Head title="New <%= human_name.downcase %>" /> <h1>New <%= human_name.downcase %></h1> <Form <%= singular_table_name %>={<%= singular_table_name %>} onSubmit={(form) => { form.transform((data) => ({ <%= singular_table_name %>: data })) form.post('<%= js_resources_path %>') }} submitText="Create <%= human_name %>" /> <br /> <div> <Link href="<%= js_resources_path %>">Back to <%= human_name.pluralize.downcase %></Link> </div> </> ) }
Version data entries
3 entries across 3 versions & 1 rubygems