defmodule Formex.CustomField.SelectAssoc do @behaviour Formex.CustomField import Ecto.Query alias Formex.Field @repo Application.get_env(:formex, :repo) @moduledoc """ This module generates a `:select` field with options downloaded from Repo. Example of use for Article with one Category: ``` schema "articles" do belongs_to :category, App.Category end ``` ``` form |> add(Formex.CustomField.SelectAssoc, :category_id, label: "Category") ``` Formex will find out that `:category_id` refers to App.Category schema and download all rows from Repo ordered by name. ## Options * `choice_label` - controls the content of `