rapidfsub

rapidfsub

In AshPhoenix.Form.submit, why params option changed to be required?

    if !Keyword.has_key?(opts, :params) do
      IO.warn("""
      The `params` option should be supplied at all times. This will be required in a future major release.
      To silence this warning without providing `params`, you can pass `params: nil`.

      For example:

          def handle_event("submit", %{"form" => params}, socket) do
            case AshPhoenix.Form.submit(socket.assigns.form, params: params) do
              ...
            end
          end
      """)
    end

Why is the params option required now?
I’m just curious about the reason for the decision.

Most Liked

zachdaniel

zachdaniel

Creator of Ash

It is due to changes in the way that Phoenix.HTML.Form tracks used fields. On submit, a new parameter is set that shows that all fields have been used, so a validation must occur at the end to “retain” that new field in the case that the form errors and returns {:error, form}

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

Other popular topics Top

lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
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
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
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

We're in Beta

About us Mission Statement