Sha256: d0d8b1d0c8470ed470d7fc0c54fb399e7b846f99a7ee5571e543faef60ca1a21

Contents?: true

Size: 991 Bytes

Versions: 5

Compression:

Stored size: 991 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

  const onDestroy = (e) => {
    if (!confirm('Are you sure you want to delete this <%= human_name.downcase %>?')) {
      e.preventDefault()
    }
  }
</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

5 entries across 5 versions & 1 rubygems

Version Path
inertia_rails-contrib-0.2.2 lib/generators/inertia_templates/scaffold/templates/svelte/Index.svelte.tt
inertia_rails-contrib-0.2.1 lib/generators/inertia_templates/scaffold/templates/svelte/Index.svelte.tt
inertia_rails-contrib-0.2.0 lib/generators/inertia_templates/scaffold/templates/svelte/Index.svelte.tt
inertia_rails-contrib-0.1.1 lib/generators/inertia_templates/scaffold/templates/svelte/Index.svelte.tt
inertia_rails-contrib-0.1.0 lib/generators/inertia_templates/scaffold/templates/svelte/Index.svelte.tt