2011-03-02 17 views
0
class StepQuiz < ActiveRecord::Base 
    belongs_to :step 
    has_many :step_quiz_questions, :dependent => :destroy 

    accepts_nested_attributes_for :step 
    accepts_nested_attributes_for :step_quiz_questions, :allow_destroy => true 
    attr_accessible :step_id, :instructions, :correct_to_pass, :retakes_allowed, :time_limit, :step_attributes, :step_quiz_questions_attributes 
end 

我允許accept_nested_attributes_for爲給定模型調用兩次。它似乎沒有錯誤地工作。accep_nested_attributes_for在模型中調用兩次

回答