Sha256: d481b9f77ef96ef8b1cb1f055499a98dc6de060223814de340463f40d7c80957

Contents?: true

Size: 784 Bytes

Versions: 9

Compression:

Stored size: 784 Bytes

Contents

<%= content_tag :div, class: "nested-fields border border-gray-200 rounded-lg p-5", data: { new_record: f.object.new_record? } do %>
  <% field.nested_attributes.each do |name, nested_attribute| %>
    <% next if nested_attribute[:field].nil? %>
    <% next unless nested_attribute[:field].visible?(action_name) %>
    <% next unless nested_attribute[:field].visible?(:form) %>

    <% nested_field = nested_attribute[:field] %>

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

  <small><%= link_to "Remove", "#", data: { action: "click->nested-form#remove_association" } %></small>

  <%= f.hidden_field :_destroy %>
<% end %>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
madmin-1.2.11 app/views/madmin/fields/nested_has_many/_fields.html.erb
madmin-1.2.10 app/views/madmin/fields/nested_has_many/_fields.html.erb
madmin-1.2.9 app/views/madmin/fields/nested_has_many/_fields.html.erb
madmin-1.2.8 app/views/madmin/fields/nested_has_many/_fields.html.erb
madmin-1.2.7 app/views/madmin/fields/nested_has_many/_fields.html.erb
madmin-1.2.6 app/views/madmin/fields/nested_has_many/_fields.html.erb
madmin-1.2.5 app/views/madmin/fields/nested_has_many/_fields.html.erb
madmin-1.2.4 app/views/madmin/fields/nested_has_many/_fields.html.erb
madmin-1.2.3 app/views/madmin/fields/nested_has_many/_fields.html.erb