Managing many_to_many relationships with AshPhoenix.Form
Hi all, I'm really struggling to get AshPhoenix.Form to manage a many to many relationship.
I have 2 resources, Organizations and Users. I have a many_to_many relationship between them. What I'm trying to achieve, is that when I create/edit an organization, there should be a multi select to be able to select related users.
From that I autogenerate the liveview with
ash_phoenix.gen.live
.
It correctly creates a form with a multi select, but the options for it are empty.
What is the best way to get the options to be the user.name? Is there AshPhoenix specific functionality for this, or is this something that i should just handle on my own?
Thanks.3 Replies
It's something you'd handle on your own 🙂
Solution
Like fetching the possible users and assigning them on mount
I figured 😄 Thanks for the help!