%= form_with model: [aircraft, squawk], multipart: true, class: "card card-body space-y-4 max-w-2xl" do |f| %> <%= f.errors_summary %> <%= f.field :priority, as: :select, collection: Squawk::PRIORITIES.invert, hint: "“Ground Aircraft” makes the aircraft not airworthy until resolved." %> <%= f.field :issue_reported, as: :textarea, label: "Issue", required: true, autofocus: true %> <%= f.field :component_id, as: :select, label: "Component (optional)", collection: component_options(aircraft) %> <%= f.field :attachments, as: :file, multiple: true, label: squawk.attachments.attached? ? "Add photos / files" : "Photos / files", hint: "Select several at once. Images, PDFs or text, up to #{Setting.max_upload_mb} MB each." %> <% if squawk.persisted? && squawk.attachments.attached? %>
Remove attached files
<% squawk.attachments.each do |file| %> <% end %>