oelshark89
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!
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming











Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
IIRC you can do this by using the
label_fieldconfiguration on the tag resource, i.eI’m not sure actually if this is set up with
but couldn’t hurt to try 
many_to_manyrelationships or notoelshark89
I gave this a try and it didn’t work. However, I’ve seen it work in another case where one table had a belongs_to relationship and the other had a has_many relationship with the same table.
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?
https://github.com/carlgleisner/ash_admin_dropdown_repro
zachdaniel
Unfortunately, I just don’t have time to look into this one
Hopefully some adventurous soul will look at ash_admin and see what can be done to extend this functionality to
many_to_manyrelationships.oelshark89
Will try to look Into it
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_idand 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_relationshiparguments.Same for the original issue, this just isn’t implemented for
many_to_manyrelationships. PRs welcome!