Sha256: 8481be3366edfa9066ba9d8178cf52c95c2ef385a9752f3e95d3015e5b1fb187

Contents?: true

Size: 887 Bytes

Versions: 1

Compression:

Stored size: 887 Bytes

Contents

<template>
  <Head title="New <%= human_name.downcase %>" />

  <div className="mx-auto md:w-2/3 w-full px-8 pt-8">
    <h1 class="font-bold text-4xl">New <%= human_name.downcase %></h1>

    <Form
      :<%= singular_table_name %>="<%= singular_table_name %>"
      submitText="Create <%= human_name %>"
      @onSubmit="handleSubmit"
    />

    <Link
      href="<%= js_resources_path %>"
      class="ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium"
    >
      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 }))
  form.post('<%= js_resources_path %>')
}
</script>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
inertia_rails-3.5.0 lib/generators/inertia_tw_templates/scaffold/templates/vue/New.vue.tt