<% attributes.each do |attribute| -%>
<% if attribute.password_digest? -%>
Password
{#if $form.errors.password}
{$form.errors.password.join(', ')}
{/if}
Password confirmation
{#if $form.errors.password_confirmation}
{$form.errors.password_confirmation.join(', ')}
{/if} <% else -%>
<%= attribute.human_name %>
<% if input_type(attribute) == "text_area" -%>
} rows="4" class="block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" /> <% elsif attribute.attachment? -%>
($form.<%= attribute.column_name %> = e.target.files[0])} class="block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" /> <% elsif attribute.attachments? -%>
($form.<%= attribute.column_name %> = Array.from(e.target.files))} class="block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" /> <% elsif input_type(attribute) == "checkbox" -%>
} class="block mt-2 h-5 w-5" /> <% else -%>
} class="block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" /> <% end -%> {#if $form.errors.<%= attribute.column_name %>}
{$form.errors.<%= attribute.column_name %>.join(', ')}
{/if} <% end -%>
<% end -%>
{submitText}