Using Elixir & Phoenix framework here.
I have a signup page where I'm validating the password & password confirmation fields using the validate_confirmation
function.
def changeset(model, params \\ %{}) do
model
|> cast(params, @required_fields, @optional_fields)
|> validate_confirmation(:password)
|> validate_length(:firstName, min: 2)
end
If I enter mismatching passwords, I get an error no function clause matching in Gettext.dngettext/6
in the browser - https://i.stack.imgur.com/eDrxE.jpg
I have the latest dependencies before posting this.
The complete stacktrace is available here - http://pastebin.com/XLKav4cu
What am I doing wrong?
You're using the old style syntax for Ecto. You now need to cast, then pass to the
validate_required
functionSee https://hexdocs.pm/ecto/Ecto.html#module-changesets for further details