Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Blank multi-select #1369

Open
Jpunt opened this Issue · 8 comments

6 participants

Jasper Haggenburg Mitsuhiro Shibuya Douglas Camata noverloop Joel Wickard Dave Steinberg
Jasper Haggenburg

I've got a basic has-many-through association:

project.rb:

    has_many :project_assets, :dependent => :delete_all, :autosave => true, :include => :asset
    has_many :assets, :through => :project_assets
    attr_accessible :asset_ids

project_asset.rb:

    belongs_to :asset
    belongs_to :project

asset.rb:

    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?

Mitsuhiro Shibuya
Collaborator

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.

Mitsuhiro Shibuya mshibuya closed this
Jasper Haggenburg

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.

Mitsuhiro Shibuya
Collaborator

Agreed. That'll be less confusing.

Mitsuhiro Shibuya mshibuya reopened this
Douglas Camata

@mshibuya how is this issue's status? Is there a way to force an initially populate in the field?

Jasper Haggenburg

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.

noverloop

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.

Joel Wickard

Spent 2 hours trying to figure out why my associations weren't showing up. They were defined correctly, it was just this issue.

Dave Steinberg

Just wanted to pile on here - I'd really like to avoid explaining to my users that this isn't really a bug. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.