Sha256: c7f75ea3007f2ee484174af85d40b8264b852eb9a51f359f2d2556852b6dc8fd

Contents?: true

Size: 908 Bytes

Versions: 1

Compression:

Stored size: 908 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>
    <strong><%= 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_templates/scaffold/templates/svelte/One.ts.svelte.tt