📅  最后修改于: 2022-03-11 14:48:01.705000             🧑  作者: Mango
defmodule Project.Helpers.Error do
@doc """
This method is used to extract changeset information for putting into flash notices
"""
def extract_changeset_error(changeset) do
[ {field, {description, [{_, validation} | _]}} | _] = changeset.errors
Macro.camelize("#{field} #{description}. It is #{validation}. ")
end
end