Just massage your enum_map return of [registered: 0, active: 1, inactive: 2, archived: 3]
into the right format, like this:
iex> [registered: 0, active: 1, inactive: 2, archived: 3] |> Enum.map(&to_string(elem(&1, 0)))
["registered", "active", "inactive", "archived"]
Although the html should accept atoms so the to_string
step should not be necessary in any case.
Honestly for enum’s though I like to use PostgreSQL Enumerations instead, can store things so they look like strings and get them back the same, but only accepts the subset.