3
새/편집 양식에 대한 belongs_to 드롭 다운의 기본 순서를 덮어 쓰려고합니다. belongs_to 관계를 기본 id desc 대신 name으로 정렬하고 싶습니다.rails_admin edit belongs_to ordering
field :theme do
associated_collection_cache_all false
associated_collection_scope do
Proc.new { |scope|
scope = scope.reorder("themes.name ASC")
}
end
end
end
재주문이 문이 포착되는 곳 중에 무시하는 것 같다
위키 (https://github.com/sferik/rails_admin/wiki/Associations-scoping)을 바탕으로 나는이 있습니다.
의견을 보내 주셔서 감사합니다. 네가 맞다면 나는 단수 이름을 써야했다. 모든 것은 콘솔에서 체크 아웃합니다. 올바른 순서로 값을 반환합니다. – Walksalong
@mscccc 솔루션을 찾았습니까? – AlexMrKlim