Does anyone have a link to a Phoenix example that shows how to hook up a ‘select’ list to a changeset? Imagine a dropdown list at the top of a table that contains different kinds of filters, eg. “all”, “active only”, etc etc
Apologies for being vague, I don’t know where to start. A working example would be fantastic!
I put the list of options in the Changeset as well, which is where I ran into trouble. Couldn’t figure out what type the options should be in an Ecto schema(‘{:array, :tuple}’ wasn’t an option).
I put the list of options in the schema because I wanted to validate the ‘selected’ option, to ensure it’s a valid option from the list. But guess that’s not necessary, since the ‘select’ only presents a couple of predetermined/valid options to the user.