Sha256: bf8dfaa92c9a64b49b47674cd1097efd6855350ca6170b350b069a8455a31ca7

Contents?: true

Size: 952 Bytes

Versions: 1

Compression:

Stored size: 952 Bytes

Contents

<script lang="ts">
  import type { <%= inertia_model_type %> } from './types'

  let { <%= singular_table_name %> } = $props<{ <%= singular_table_name %>: <%= inertia_model_type %> }>()
</script>

<div>
<% attributes.reject(&:password_digest?).each do |attribute| -%>
  <p class="my-5">
    <strong class="block font-medium mb-1"><%= attribute.human_name %>:</strong>
<% if attribute.attachment? -%>
    {#if <%= singular_table_name %>.<%= attribute.column_name %>}
      <a href={<%= singular_table_name %>.<%= attribute.column_name %>.url}>
        {<%= singular_table_name %>.<%= attribute.column_name %>.filename}
      </a>
    {/if}
  </p>
<% elsif attribute.attachments? -%>
  </p>
  {#each <%= singular_table_name %>.<%= attribute.column_name %> as { url, filename }}
    <div>
      <a href={url}>{filename}</a>
    </div>
  {/each}
<% else -%>
    {<%= singular_table_name %>.<%= attribute.column_name %>}
  </p>
<% end -%>
<% end -%>
</div>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
inertia_rails-3.5.0 lib/generators/inertia_tw_templates/scaffold/templates/svelte/One.ts.svelte.tt