Sha256: 76354a17ac87046655424eb4cd1a7db269f0eb5254a68c46d4c89cc6a4eeb9c8

Contents?: true

Size: 1.22 KB

Versions: 2

Compression:

Stored size: 1.22 KB

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>

<div class="mx-auto md:w-2/3 w-full px-8 pt-8">
  {#if flash.notice}
    <p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block">
      {flash.notice}
    </p>
  {/if}

  <div class="flex justify-between items-center">
    <h1 class="font-bold text-4xl"><%= human_name.pluralize %></h1>
    <Link
      href="<%= js_new_resource_path %>"
      class="rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium"
    >
      New <%= human_name.downcase %>
    </Link>
  </div>

  <div class="min-w-full">
    {#each <%= plural_table_name %> as <%= singular_table_name %> (<%= singular_table_name %>.id)}
      <<%= inertia_component_name %> {<%= singular_table_name %>} />
      <p>
        <Link
          href={`<%= js_resource_path %>`}
          class="ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium"
        >
          Show this <%= human_name.downcase %>
        </Link>
      </p>
    {/each}
  </div>
</div>

Version data entries

2 entries across 2 versions & 2 rubygems

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