oelshark89
How to show tag names in a dropdown for many-to-many relationships in AshAdmin?
Hello Ash community, happy to be part of this family!
I’m running into an issue while building a knowledge base. Each entry in my knowledge base should be associated with one or more tags. I’ve set up three tables:
-
tags(stores tag metadata) -
entries(knowledge base items) -
entry_tags(join table for many-to-many)
The problem: I’d like to select tags dynamically by name from a dropdown in AshAdmin. But this doesn’t work out of the box, because the Entry resource doesn’t have a direct belongs_to with Tag—it only has a many_to_many through EntryTag. If I add a belongs_to, I’d break 1NF and duplicate the relationship design.
What’s the recommended way in Ash to handle this? Ideally I’d like a clean dropdown (or multi-select) that shows tag names and correctly links them through the join table.
Any suggestions or best practices would be greatly appreciated!
Most Liked
zachdaniel
Gotcha, yeah we probably need to add that functionality to ash_admin in that case ![]()
Please open an issue
carlgleisner
I’ve opened an issue for this now ![]()
https://github.com/ash-project/ash_admin/issues/362
@oelshark89, maybe you’re interested in having a look at the reproduction to see if it corresponds to your observations?
oelshark89
Last Post!
zachdaniel
Okay, actually I am looking into this. It looks like this is setup only for when you are editing the foreign key directly via organization_id and only for belongs_to relationships currently.
the default create action is not using manage_relationship, and the non default one is. So it’s not anything to do with default or non-default. This just isn’t implemented for manage_relationship arguments.
Same for the original issue, this just isn’t implemented for many_to_many relationships. PRs welcome!
Popular in Questions
Other popular topics
Latest Ash Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security










