Imagine we add a mark that doesn't exist, an invalid changeset will be returned.
We have to transform thoses changeset to inline it and allow user to display error using
<%= error_tag f, :field %>
Example of invalid changeset
#Ecto.Changeset<
action: nil,
changes: %{
title: #Ecto.Changeset<
action: :insert,
changes: %{
content: #Ecto.Changeset<
action: :insert,
changes: %{
content: [
#Ecto.Changeset<
action: :insert,
changes: %{
content: [
#Ecto.Changeset<
action: :insert,
changes: %{text: "Hello world"},
errors: [marks: {"is invalid", []}],
data: #ExProsemirror.Block.Text<>,
valid?: false
>
]
},
errors: [],
data: #ExProsemirror.Block.Paragraph<>,
valid?: false
>
]
},
errors: [],
data: #ExProsemirror.Block.Doc<>,
valid?: false
>
},
errors: [],
data: #ExProsemirror.Schema<>,
valid?: false
>,
title_plain: "{\"type\":\"doc\",\"content\":[{\"type\":\"p\",\"content\":[{\"type\":\"text\",\"marks\":[{\"type\":\"em\"},{\"type\":\"strong\"},{\"type\":\"underline\"}],\"text\":\"Hello world\"}]}]}"
},
errors: [],
data: #ExProsemirrorSample.Article<>,
valid?: false
>
Imagine we add a mark that doesn't exist, an invalid changeset will be returned.
We have to transform thoses changeset to inline it and allow user to display error using
Example of invalid changeset