2011-03-02 42 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在模型中调用两次

回答