Sha256: ea901ab20e7ca420433753b4046c04ef6dca1d4dfe0d84a830f716fbbabc1b97

Contents?: true

Size: 1.42 KB

Versions: 5

Compression:

Stored size: 1.42 KB

Contents

<%%= form_with(model: <%= model_resource_name %>, data: { controller: "bridge--form", action: "turbo:submit-start->bridge--form#submitStart turbo:submit-end->bridge--form#submitEnd" }) do |form| %>
  <%% if <%= singular_table_name %>.errors.any? %>
    <div style="color: red">
      <h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>

      <ul>
        <%% <%= singular_table_name %>.errors.each do |error| %>
          <li><%%= error.full_message %></li>
        <%% end %>
      </ul>
    </div>
  <%% end %>

<% attributes.each do |attribute| -%>
  <div>
<% if attribute.password_digest? -%>
    <%%= form.label :password, style: "display: block" %>
    <%%= form.password_field :password %>
  </div>

  <div>
    <%%= form.label :password_confirmation, style: "display: block" %>
    <%%= form.password_field :password_confirmation %>
<% elsif attribute.attachments? -%>
    <%%= form.label :<%= attribute.column_name %>, style: "display: block" %>
    <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true %>
<% else -%>
    <%%= form.label :<%= attribute.column_name %>, style: "display: block" %>
    <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %> %>
<% end -%>
  </div>

<% end -%>
  <div>
    <%%= form.submit nil, data: { "bridge--form-target": "submit", "bridge-title": "Save" } %>
  </div>
<%% end %>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
strada-rails-0.0.5 lib/generators/strada/scaffold/templates/_form.html.erb.tt
strada-rails-0.0.4 lib/generators/strada/scaffold/templates/_form.html.erb.tt
strada-rails-0.0.3 lib/generators/strada/scaffold/templates/_form.html.erb.tt
strada-rails-0.0.2 lib/generators/strada/scaffold/templates/_form.html.erb.tt
strada-rails-0.0.1 lib/generators/strada/scaffold/templates/_form.html.erb.tt