Sha256: 73430732c81a078a655d4126d7dc056842be161fc9e61f0d4158e4575e06e8d0

Contents?: true

Size: 957 Bytes

Versions: 1

Compression:

Stored size: 957 Bytes

Contents

<script lang="ts">
  import { Link } from '@inertiajs/svelte'
  import <%= inertia_component_name %> from './<%= inertia_component_name %>.svelte'
  import type { <%= inertia_model_type %> } from './types'

  export let <%= plural_table_name %>: <%= inertia_model_type %>[]
  export let flash: { notice?: string }
</script>

<svelte:head>
  <title><%= human_name.pluralize %></title>
</svelte:head>

{#if flash.notice}
  <p class="notice">{flash.notice}</p>
{/if}

<h1><%= human_name.pluralize %></h1>

<div>
  {#each <%= plural_table_name %> as <%= singular_table_name %> (<%= singular_table_name %>.id)}
    <div>
      <<%= inertia_component_name %> {<%= singular_table_name %>} />
      <p>
        <Link href={`<%= js_resource_path %>`}>Show this <%= human_name.downcase %></Link>
      </p>
    </div>
  {/each}
</div>

<Link href="<%= js_new_resource_path %>">New <%= human_name.downcase %></Link>

<style>
  .notice {
    color: green;
  }
</style>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
inertia_rails-3.5.0 lib/generators/inertia_templates/scaffold/templates/svelte4/Index.ts.svelte.tt