<%= form_with model: [:admin, airport], class: "card card-body space-y-4 max-w-2xl" do |f| %> <%= f.errors_summary %>
<%= f.field :ident, label: "Code", required: true, hint: "The code you log, e.g. 0R8." %> <%= f.field :name, required: true, wrapper: { class: "sm:col-span-2" } %> <%= f.field :kind, as: :select, label: "Type", collection: Airport::KINDS.map { [_1.humanize, _1] } %> <%= f.field :municipality, label: "Town" %> <%= f.field :region, placeholder: "US-RI", hint: "ISO region" %> <%= f.field :latitude, as: :number, step: "any" %> <%= f.field :longitude, as: :number, step: "any" %> <%= f.field :elevation_ft, as: :number, label: "Elevation (ft)" %>

Custom airports are kept when the database is updated from OurAirports. To sync flights at this airport to AirTrail, add it there too with the same code (or map it on your AirTrail sync page).

<%= f.submit "Save" %><%= link_to "Cancel", admin_airports_path, class: "btn-secondary" %>
<% end %> <% if airport.persisted? %>
<%= delete_button "Remove #{airport.ident}", admin_airport_path(airport) %>
<% end %>