Dynamic select with optgroup - how to group

Are you using Phoenix? There’s a good list of form helpers here: https://hexdocs.pm/phoenix_html/Phoenix.HTML.Form.html I guess you’ll want something like Rails’ grouped_collection_select.