Sha256: 6c6e97d0d3c2d6168f8c6fbbea6cbed010a5cc6733177e2b358950dff6c02481

Contents?: true

Size: 1.09 KB

Versions: 11

Compression:

Stored size: 1.09 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="mb-4 rounded-md text-sm text-red-700 bg-red-100 p-4">
      <div class="mb-2 font-medium leading-5 text-red-800">There was <%= pluralize form.object.errors.full_messages.count, "error" %> with your submission</div>

      <% form.object.errors.full_messages.each do |message| %>
        <div class="ml-4"><%= message %></div>
      <% end %>
    </div>
  <% end %>

  <% resource.attributes.values.each do |attribute| %>
    <% next if attribute.field.nil? %>
    <% next unless attribute.field.visible?(action_name) %>
    <% next unless attribute.field.visible?(:form) %>

    <div class="mb-4 md:flex">
      <%= render partial: attribute.field.to_partial_path("form"), locals: { field: attribute.field, record: record, form: form, resource: resource } %>
    </div>
  <% end %>

  <%= form.submit class: "bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow" %>
<% end %>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
madmin-1.2.11 app/views/madmin/application/_form.html.erb
madmin-1.2.10 app/views/madmin/application/_form.html.erb
madmin-1.2.9 app/views/madmin/application/_form.html.erb
madmin-1.2.8 app/views/madmin/application/_form.html.erb
madmin-1.2.7 app/views/madmin/application/_form.html.erb
madmin-1.2.6 app/views/madmin/application/_form.html.erb
madmin-1.2.5 app/views/madmin/application/_form.html.erb
madmin-1.2.4 app/views/madmin/application/_form.html.erb
madmin-1.2.3 app/views/madmin/application/_form.html.erb
madmin-1.2.2 app/views/madmin/application/_form.html.erb
madmin-1.2.1 app/views/madmin/application/_form.html.erb