Sha256: d117ca18db423b0c95a56fef63765db2647d57b467a785b3c633fb0355215172

Contents?: true

Size: 838 Bytes

Versions: 3

Compression:

Stored size: 838 Bytes

Contents

<script>
  import { Link } from '@inertiajs/svelte'
  import <%= inertia_component_name %> from './<%= inertia_component_name %>.svelte'

  export let <%= plural_table_name %>
  export let flash
</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

3 entries across 3 versions & 2 rubygems

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