2013-01-17 1 views
1

나는 간단한 has_many 첨부 상황이?RailsAdmin의 has_many 직접 생성

1)/편집에게 ProjectImage 인스턴스를 생성하고 프로젝트 (당신이 그것을 검색 할 필요)에 추가 :

지금 두 가지 방법 (! 모두 빨아)이있다.

모달를 만들고 1과 동일하다 이후

2) Add a new Project image)

enter image description here

답변

1

키는 다음을 사용 accepts_nested_attributes_for중첩 특성은.

예 :

has_many :images, :class_name => 'ProjectImage', :dependent => :destroy, :inverse_of => :project 
accepts_nested_attributes_for :images, :allow_destroy => true