Sha256: 787cc3cd5d266c2035e70033b17dfa9c68cdc10ad9c3b8962de6634b4a312124

Contents?: true

Size: 1.11 KB

Versions: 8

Compression:

Stored size: 1.11 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.each do |attribute| %>
    <% next if attribute[:field].nil? %>
    <% next unless attribute[:field].visible?(action_name) %>
    <% next unless attribute[:field].visible?(:form) %>

    <% field = attribute[:field] %>

    <div class="mb-4 flex">
      <%= render partial: field.to_partial_path("form"), locals: { field: 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

8 entries across 8 versions & 1 rubygems

Version Path
madmin-1.2.0 app/views/madmin/application/_form.html.erb
madmin-1.1.0 app/views/madmin/application/_form.html.erb
madmin-1.0.2 app/views/madmin/application/_form.html.erb
madmin-1.0.1 app/views/madmin/application/_form.html.erb
madmin-1.0.0 app/views/madmin/application/_form.html.erb
madmin-1.0.0.beta2 app/views/madmin/application/_form.html.erb
madmin-1.0.0.beta1 app/views/madmin/application/_form.html.erb
madmin-0.1.1 app/views/madmin/application/_form.html.erb