You can use the select/4 function from Phoenix.HTML.Form.
In your controller you can fetch fetch the parents with a query:
query = from(p in Parent, select: {p.id, p.name})
parents = Repo.all(query)
The reason we need this query is to format the values in the expected format:
Values are expected to be an Enumerable containing two-item tuples (like maps and keyword lists) or any Enumerable where the element will be used both as key and value for the generated select.
You can then use select/4 in your template:
<%= select f, :parent_id, @parents ,class: "form-control" %>
You can also transform the records using Enum.map/2 if you already have the parents:
parents = Repo.all(Parent) |> Enum.map(&{&1.id, &1.name})