Sha256: 6eb945d36f565f6cea358933f01292147c60228b0e3d279fadb2662f1c11241d

Contents?: true

Size: 1.17 KB

Versions: 38

Compression:

Stored size: 1.17 KB

Contents

<%%= form_with(model: <%= model_resource_name %>) do |form| %>
  <%% if <%= singular_table_name %>.errors.any? %>
    <div id="error_explanation">
      <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 class="field">
<% if attribute.password_digest? -%>
    <%%= form.label :password %>
    <%%= form.password_field :password %>
  </div>

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

<% end -%>
  <div class="actions">
    <%%= form.submit %>
  </div>
<%% end %>

Version data entries

38 entries across 38 versions & 4 rubygems

Version Path
railties-6.1.7.10 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.7.9 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.7.8 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.7.7 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.7.6 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.7.5 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.7.4 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.7.3 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.7.2 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.7.1 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.7 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.6.1 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.6 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.5.1 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.5 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.4.7 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.4.6 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-6.1.4.5 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt