Sha256: cefffa5fdbf80e7778d1b473f07d5ac7c170c854716c9a932ebc357ac2ddfd56

Contents?: true

Size: 974 Bytes

Versions: 1

Compression:

Stored size: 974 Bytes

Contents

import { Head, Link } from '@inertiajs/react'
import <%= inertia_component_name %> from './<%= inertia_component_name %>'

export default function Show({ <%= singular_table_name %>, flash }) {
  return (
    <>
      <Head title={`<%= human_name %> #${<%= singular_table_name %>.id}`} />

      {flash.notice && <p style={{ color: 'green' }}>{flash.notice}</p>}

      <h1><%= human_name %> #{<%= singular_table_name %>.id}</h1>

      <<%= inertia_component_name %> <%= singular_table_name %>={<%= singular_table_name %>} />

      <div>
        <Link href={`<%= js_edit_resource_path %>`}>Edit this <%= human_name.downcase %></Link>
        {' | '}
        <Link href="<%= js_resources_path %>">Back to <%= human_name.pluralize.downcase %></Link>

        <br />

        <Link
          href={`<%= js_resource_path %>`}
          as="button"
          method="delete"
        >
          Destroy this <%= human_name.downcase %>
        </Link>
      </div>
    </>
  )
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
inertia_rails-3.5.0 lib/generators/inertia_templates/scaffold/templates/react/Show.jsx.tt