<%= form_with model: [aircraft, collection], class: "card card-body space-y-4 max-w-2xl" do |f| %> <%= f.errors_summary %> <%= f.field :name, required: true %> <%= f.field :description, as: :textarea, rows: 2 %> <%= f.field :visibility, as: :select, label: "Share-link visibility", collection: DocumentCollection::VISIBILITIES.invert %> <%= f.field :starred, as: :checkbox, label: "Starred (shown first)" %>
<%= f.submit "Save Collection" %><%= link_to "Cancel", aircraft_documents_path(aircraft), class: "btn-secondary" %>
<% end %> <% if collection.persisted? %>
<%= delete_button "Delete collection and its documents", aircraft_document_collection_path(aircraft, collection) %>
<% end %>