iyjim

iyjim

How to make the function that provids default value of an argument of a generic action be able to get the actor?

Ash.Resource — ash v3.5.2 says that the default value can be a zero arity function e.g. &MyMod.my_fun/0 or a value.

What if the default argument value should depend on the actor? Is there a way to get the actor in the zero arity function?

Please help.

Marked As Solved

zachdaniel

zachdaniel

Creator of Ash

So the problem there appears to be that it’s forwarding the params option to the underlying action input call. Could you open an issue on ash_phoenix?

Also Liked

zachdaniel

zachdaniel

Creator of Ash

Oh you’re right, you’d want to validate once with params after calling the action, sorry :slight_smile: my inner LLM hallucinated that one :joy:

zachdaniel

zachdaniel

Creator of Ash

Hmm…looking at the code, I wasn’t hallucinating. There definitely should be a params option when creating new forms. I tried it myself just recently and it worked :smiley:

Last Post!

iyjim

iyjim

I just created an issue on ash_phoenix, please have a look:

https://github.com/ash-project/ash_phoenix/issues/358

Thank you!

Where Next?

Popular in Questions Top

vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
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
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
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
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
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

We're in Beta

About us Mission Statement