mirror of
https://github.com/ash-project/ash_phoenix.git
synced 2024-09-20 07:12:49 +12:00
Fix: form_for deprecation warning (#84)
This commit is contained in:
parent
0dea54b575
commit
1a1ff1a568
1 changed files with 16 additions and 5 deletions
|
@ -930,7 +930,7 @@ defmodule AshPhoenix.FilterForm do
|
||||||
impl: __MODULE__,
|
impl: __MODULE__,
|
||||||
id: opts[:id] || form.id,
|
id: opts[:id] || form.id,
|
||||||
name: opts[:as] || form.name,
|
name: opts[:as] || form.name,
|
||||||
errors: [],
|
errors: opts[:errors] || [],
|
||||||
data: form,
|
data: form,
|
||||||
params: form.params,
|
params: form.params,
|
||||||
hidden: hidden,
|
hidden: hidden,
|
||||||
|
@ -945,10 +945,21 @@ defmodule AshPhoenix.FilterForm do
|
||||||
|> Enum.map(fn {component, index} ->
|
|> Enum.map(fn {component, index} ->
|
||||||
name = Map.get(component, :name, phoenix_form.name)
|
name = Map.get(component, :name, phoenix_form.name)
|
||||||
|
|
||||||
Phoenix.HTML.Form.form_for(component, "action",
|
case component do
|
||||||
transform_errors: form.transform_errors,
|
%AshPhoenix.FilterForm{} ->
|
||||||
as: name <> "[components][#{index}]"
|
to_form(component,
|
||||||
)
|
as: name <> "[components][#{index}]",
|
||||||
|
id: component.id,
|
||||||
|
errors: AshPhoenix.FilterForm.errors(component)
|
||||||
|
)
|
||||||
|
|
||||||
|
%AshPhoenix.FilterForm.Predicate{} ->
|
||||||
|
Phoenix.HTML.FormData.AshPhoenix.FilterForm.Predicate.to_form(component,
|
||||||
|
as: name <> "[components][#{index}]",
|
||||||
|
id: component.id,
|
||||||
|
errors: AshPhoenix.FilterForm.errors(component)
|
||||||
|
)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue