【发布时间】:2021-03-18 12:41:44
【问题描述】:
我有一个具有这些关联的模型:
has_many :ad_places, dependent: :destroy
has_many :places, through: :ad_places
在我的 Rails Admin 初始化程序中:
edit do
field :places do
inline_add false
associated_collection_cache_all true
associated_collection_scope do
Proc.new do |scope|
scope = scope.order(:place_on_page)
end
end
end
field :html, :text
field :document
end
但我在多选中的条目不是由place_on_page 排序的,Rails Admin 的请求是ORER by places.id desc
它与this fix 修复的this guy 基本相同,只是它对我不起作用。
我错过了什么吗?
【问题讨论】:
标签: rails-admin