inputs_for not working when I do manage_relationship in Ash.Changeset.before_action
Hi team,
I would like to ask smth about inputs_for, so when I do manage relatioinship this way
change manage_relationship(:beds, type: :create)
in the action, inputs_for works.
But when I put the manage_relationship in before_action, it doesn't work, e.g.:
It has this error:
How can I make inputs_for work when I need to do manage_relationship in the change function? Thanks so much.2 Replies
Yep, so it only automatically sets up the form if you do it as an explicit change. You have to configure the forms manually if you want to do it inside of a hook
https://hexdocs.pm/ash_phoenix/nested-forms.html#manually-defining-nested-forms
Thanks for the reply, I will take a look and try, thanks again.