Sha256: 8983f25b1158a8226b278a114dcd27f5fb54da8ff5e90066827598826910f5b7

Contents?: true

Size: 711 Bytes

Versions: 6

Compression:

Stored size: 711 Bytes

Contents

import { Link, Head } from '@inertiajs/react'
import Form from './Form'

export default function New({ <%= singular_table_name %> }) {
  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.downcase %>"
      />

      <br />

      <div>
        <Link href="<%= js_resources_path %>">Back to <%= human_name.pluralize.downcase %></Link>
      </div>
    </>
  )
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
inertia_rails-contrib-0.3.0 lib/generators/inertia_templates/scaffold/templates/react/New.jsx.tt
inertia_rails-contrib-0.2.2 lib/generators/inertia_templates/scaffold/templates/react/New.jsx.tt
inertia_rails-contrib-0.2.1 lib/generators/inertia_templates/scaffold/templates/react/New.jsx.tt
inertia_rails-contrib-0.2.0 lib/generators/inertia_templates/scaffold/templates/react/New.jsx.tt
inertia_rails-contrib-0.1.1 lib/generators/inertia_templates/scaffold/templates/react/New.jsx.tt
inertia_rails-contrib-0.1.0 lib/generators/inertia_templates/scaffold/templates/react/New.jsx.tt