blset

blset

Cast_embed does not take error_message into account

Hello


|>
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

First Post!

RudManusachi

RudManusachi

I think you want to pass :required_message option:

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

See options here

Last Post!

blset

blset

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

thanks

Where Next?

Popular in Questions Top

lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement