Sha256: 0ed2b17756f327d63ce6c69a59684171431b91a5800a24cb790c1b77d692c98e

Contents?: true

Size: 721 Bytes

Versions: 6

Compression:

Stored size: 721 Bytes

Contents

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

  <h1>New <%= human_name.downcase %></h1>

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

  <br />

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

<script setup>
import { Link, Head } 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

6 entries across 6 versions & 1 rubygems

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