belongs_to association drop-down / autocomplete fields fail for large data sets

412 views
Skip to first unread message

Robert Head

unread,
Jun 5, 2013, 8:30:18 PM6/5/13
to rails...@googlegroups.com
So, I've got a Show model and an Artist model.  On the Rails Admin edit page for a Show, the Artist field shows up fine.

It works correctly until I reach a certain number of Artists.  Somewhere between 100 and 200.

Then the dropdown and search fail completely.  No dropdown, no autocomplete query results.

If I set associated_collection_cache_all to true, then I get a dropdown, but queries only search in the preloaded records and it doesn't hit the server.

If I set associated_collection_cache_all to false, I get no drop-down and no search results, regardless of what I try (or don't try) with associated_collection_scope.  The rails logs show that it is receiving the query and returning a 200 pjax response of some kind, but the view does nothing with it.

Help?

Thanks,
Rob


class Show < ActiveRecord::Base
  belongs_to :artist, inverse_of: :shows

  attr_accessible(:artist, :artist_id, as: [:default, :admin])
  
  rails_admin do
    list do
      field :id
      field :artist
    end

    edit do
      field :id
      field :artist
    end
  end
end

Benoit Bénézech

unread,
Jun 18, 2013, 5:36:38 AM6/18/13
to rails...@googlegroups.com
Probably a JS bug :/
Reply all
Reply to author
Forward
0 new messages