%= 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| %> <% nested_field = nested_attribute.field %> <% next if nested_field.nil? %> <% next unless nested_field.visible?(action_name) %> <% next unless nested_field.visible?(:form) %>