In my application
Product has many categories though category_has_products
Category has many products though category_has_products
Initially I used
at product.rb
default_scope { includes(:brand, :categories) }
and in rails_admin config set it as
field :categories, :string do
searchable [{Category => :name}]
end
This works like a charm. This got in to performance issue due to has_many_through(other pages using product details got affected)
So I removed the default_scope from product.
After that I am getting
PG::UndefinedTable: ERROR: missing FROM-clause entry for table "categories"
any idea on how to preload categories?
Note: rails_admin gem version is 0.8.1 only I am not able to update to latest version 1.X.X
I found answer
in product.rb
admin_product_config.rb
To add filter option
Thank you @jxpx777 https://github.com/sferik/rails_admin/issues/1348#issuecomment-39373394