Sha256: 68c969942733b9b11a4ff1a501473c6d44a83e19e20f2b4b2b1762eab50c384e

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

<%= form_with model: [:madmin, record], url: (record.persisted? ? resource.show_path(record) : resource.index_path), local: true do |form| %>
  <% if form.object.errors.any? %>
    <div class="alert alert-danger">
      <div class="">There was <%= pluralize form.object.errors.full_messages.count, "error" %> with your submission:</div>

      <ul>
        <% form.object.errors.full_messages.each do |message| %>
          <li><%= message %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <% resource.attributes.values.select{ _1.field.present? && _1.field.visible?(action_name) }.each do |attribute| %>
    <div class="form-group">
      <%= render "madmin/shared/label", form: form, field: attribute.field %>
      <%= render partial: attribute.field.to_partial_path("form"), locals: { field: attribute.field, record: record, form: form, resource: resource } %>
      <%= tag.div attribute.field.options.description, class: "form-description" if attribute.field.options.description.present? %>
    </div>
  <% end %>

  <%= form.submit class: "btn btn-primary" %>
  <%= link_to "Cancel", (record.persisted? ? resource.show_path(record) : resource.index_path), class: "btn" %>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
madmin-2.0.0 app/views/madmin/application/_form.html.erb