I've got a basic has-many-through association:
has_many :project_assets, :dependent => :delete_all, :autosave => true, :include => :asset
has_many :assets, :through => :project_assets
has_many :project_assets, :dependent => :delete_all
has_many :projects, :through => :project_assets
I can add new assets through this successfully, but the left part of the multi-select remains blank, so I can't select assets that are already in the model. What could be the reason for this?
This is expected behavior when you have many assets(more than 100 by default).
You need to fill search box above the left pane, and matching assets will be shown in the left pane, retrieved via Ajax request.
Thanks for your answer. I think though, that there should be some indication for the user that this is the case, and it's not plain broken in some way.
Agreed. That'll be less confusing.
@mshibuya how is this issue's status? Is there a way to force an initially populate in the field?
Ha! Just experienced the exact same problem and found this thread again. Is there any progress on this issue? I'd like to do it myself, but I'm not sure when I'll find the time.
This is a usability issue, can there be some sort of warning on the admin panel that they have to use the search instead, spent a few hours debugging a non-issue.
it also affects rails_admin has_and_belongs_to_many relationships.
Spent 2 hours trying to figure out why my associations weren't showing up. They were defined correctly, it was just this issue.
Just wanted to pile on here - I'd really like to avoid explaining to my users that this isn't really a bug. :)
Throw one more on the pile of people who just spent way too long on this "issue" when all we need is a simple note somewhere around the search box. We have customer service reps who will be using this, and they probably wont remember the required functionality if they infrequently access that part of the edit form.
How do you think the note should be read? I couldn't come up with a concise phrase...
Personally I would really like it if the multi select box was disabled and the body said something like "Too many objects, use search box above." (Maybe just "Use search box above." so it fits on one line.)
And if you type a query in and there are no results it would stay disabled and read "No objects found."
It took me a while to find this post. I encountered the same issue.
Show indication in filtering-multiselect widget to reduce confusion
Added note as described above, thanks @zenkalia !
Excellent news! 👍