I have a list of values like this
result = [:id, :title, :id]
I am using comprehensions to iterate over them and display the error message which looks like this:
for n <- result, do: {n, "field doesn't exist"}
[
id: "field doesn't exist",
title: "field doesn't exist",
id: "field doesn't exist"
]
what I want the output is like this:
errors:{
id : "field doesn't exist"
}
How can I format it like this?
Thanks