% content_for :title, "Import ADs" %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<%= form_with url: aircraft_ad_import_path(@aircraft), multipart: true, class: "card card-body space-y-4 lg:col-span-2" do |f| %>
Import ADs from the FAA DRS
<%= f.label :file, "DRS export (.csv or .xlsx)", class: "label" %>
<%= f.file_field :file, accept: ".xlsx,.csv", required: true,
class: "block text-sm text-slate-600 file:mr-3 file:rounded-md file:border-0 file:bg-slate-100 file:px-3 file:py-1.5 file:text-sm file:font-medium hover:file:bg-slate-200" %>
<%= f.submit "Upload & Preview", class: "btn-primary" %>
Nothing is saved until you confirm on the next page.
<% end %>
Getting the file
- On drs.faa.gov, search Airworthiness Directives for this aircraft's make and model (add the engine and propeller too).
- Save the results as Excel. The Excel file links each AD number to its DRS page; the CSV doesn't, so a CSV import won't have links.
- Upload it here.
ADs already tracked are matched by number, so importing the Excel file after a CSV import just adds the links.