Cast_embed does not take error_message into account


cast_embed(:inds, required: true, error_message: “ddd”)

does not take the error message into account when the embedded list is empty

I still get the error message can’t be blank

more over there is also an invalid_message option but it’s not clear when it is triggered

I think you want to pass :required_message option:

|> cast_embed(:inds, required: true, required_message: “ddd”)

See options here

thanks, but same omission with :required_message

all is ok after some restart thanks

For helping future readers it’s considered good discussion post to clarify how did you solve your problem.

using :required_message (as mentioned in the doc), first did nothing, but it was probably because the dev server was lagging or something like that because after a restart of the server

mix phx.server

it worked

in my experience,
the dev server sometimes (not frequently) lags or seems wrong after many edits in the files or duplication of files then change of the module name.

But everything gets right after a restart or in rare cases after deletion of _build and recompilation from zero