Skip to content

Commit a835ea7

Browse files
Add gender options to patient creation form
1 parent e3f6405 commit a835ea7

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

ndb_rest_api/lib/ndb_rest_api_web/controllers/patient_controller.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ defmodule NdbRestApiWeb.PatientController do
2525
|> redirect(to: ~p"/patients/#{patient}")
2626

2727
{:error, %Ecto.Changeset{} = changeset} ->
28-
render(conn, :new, changeset: changeset)
28+
genders = Genders.list_genders()
29+
render(conn, :new, changeset: changeset, genders: genders)
2930
end
3031
end
3132

ndb_rest_api/lib/ndb_rest_api_web/controllers/patient_html/new.html.heex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<:subtitle>Use this form to manage patient records in your database.</:subtitle>
44
</.header>
55

6-
<.patient_form changeset={@changeset} patients={@patients} genders={@genders} action={~p"/patients"} />
6+
<.patient_form changeset={@changeset} genders={@genders} action={~p"/patients"} />
77

88
<.back navigate={~p"/patients"}>Back to patients</.back>

0 commit comments

Comments
 (0)