도움이 필요합니다! 나는 조사를 위해이 개 모델을 가지고 :Active Admin의 중첩 된 양식
다음과 같이 질문에 대한 모델이 있습니다class Poll < ActiveRecord::Base
has_many :poll_questions, :dependent => :destroy
accepts_nested_attributes_for :poll_questions, :reject_if => lambda { |a| a[:text].blank? }, :allow_destroy => true
end
는 (이들 assocciations이 올 것 같다) 활성 관리자에서 또한
class PollQuestion < ActiveRecord::Base
belongs_to :poll
has_many :poll_answers, :dependent => :destroy
accepts_nested_attributes_for :poll_answers, :reject_if => lambda { |a| a[:text].blank? }, :allow_destroy => true
end
:
ActiveAdmin.register Poll do
form do |f|
f.inputs "Main poll" do
f.input :title
f.input :description
end
f.inputs do
f.has_many :poll_questions do |question|
question.input :text
end
end
f.buttons
end
end
실제 질문 개체를 생성하지 않는 아름다운 형태가 있습니다! 왜? 문제를 해결하기 위해 최선을 다했지만 실패했습니다.
어떤 대답 변종을 만드는 방법에 대한? 관리자 패널 에서요? – prikha
작동하지 않습니까? [Ryan's Episode] (http://railscasts.com/episodes/196-nested-model-form-part-1)에 적극적인 관리자가 있습니까? – prikha
누군가가 해결책을 가지고 있다면 나는 또한 관심이있다 ... –