Sha256: dbe2f59e8f28c3b827a26eb38ddd7df33d75666eadad2d772a190096f3a0dbe4

Contents?: true

Size: 1.22 KB

Versions: 84

Compression:

Stored size: 1.22 KB

Contents

<%%= form_with(model: <%= model_resource_name %>) 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 %>
  </div>
<%% end %>

Version data entries

84 entries across 80 versions & 8 rubygems

Version Path
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/railties-7.0.5.1/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/railties-7.0.5.1/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.2.0.beta2 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.1.3.4 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.0.8.4 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.2.0.beta1 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.1.3.2 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.1.3.1 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.0.8.1 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.1.3 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/railties-7.0.3.1/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.1.2 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.1.1 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.1.0 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.1.0.rc2 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.1.0.rc1 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.1.0.beta1 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
railties-7.0.8 lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt