Help with manage_related

The AshAdmin Demo uses the "manage_related" option in form to allow the Admin UI to know details about displaying a related resource. When I use "manage_related" (just as shown in the video), I get the following compilation error: "(CompileError) undefined function manage_related/1 (there is no such import) Stacktrace: (ash_admin 0.8.0) expanding macro: AshAdmin.Resource.Form.form/1 ... Any idea what I am overlooking or doing incorrectly? Can't seem to find "manage_related" term anywhere. Thanks for your help.
3 Replies
ZachDaniel
ZachDaniel•3y ago
That may just be an old example manage_relationship is what we use now oh, wait That is really old šŸ˜† it figures it out based on the actions Yeah, so what you'd do is modify your action:
create :create do
argument :comments, {:array, :map}
# This is just an example. You should read the documentation on
# `Ash.Changeset.manage_relationship` before you use it
change manage_relationship(:comments, type: :direct_control)
end
create :create do
argument :comments, {:array, :map}
# This is just an example. You should read the documentation on
# `Ash.Changeset.manage_relationship` before you use it
change manage_relationship(:comments, type: :direct_control)
end
earl7731
earl7731OP•3y ago
Zach, thanks for the prompt reply. I will review see if I can fix the problem using your suggestions. Thanks again. Great work, appreciate you and the team working on Ash.

Did you find this page helpful?