2017-09-06 4 views
0
나는 아주 기본적인 has_many :through 설정 데

:ActiveAdmin을 형태 : has_many : 통해 체크 박스와 같은 추가 데이터

Form Mockup

:

class Housing < ApplicationRecord 
    has_many :facilities_housings 
    has_many :facilities, through: :facilities_housings 

    ... 
end 

class Facility < ApplicationRecord 
    has_many :facilities_housings 
    has_many :housings, through: :facilities_housings 

    ... 
end 

class FacilitiesHousing < ApplicationRecord 

belongs_to :facility, inverse_of: :facilities_housings 
belongs_to :housing, inverse_of: :facilities_housings 

... 
end 

나는 같은과 같은 양식을 만들려면을

모든 시설은 첫 번째 확인란에 따라 나열되고 추가/제거되어야합니다.

나는 activeadmin에 포함 된 도우미에서 has_many과 매우 관련이 있지만이 유스 케이스에는 UX가 좋지 않음을 알고 있습니다.

답변

0

이 질문이 있습니까? #4724#4719이 적용될 수 있습니다. ActiveAdmin에서 제공하는 기본 기능이 충분하지 않은 경우 자체적 인 부분 및 사용자 정의 Javascript로 재정의 할 수 있습니다.