I have a simple application that has three models Assessment, QuestionandAssessmentQuestion
As AssessmentI have such an association,
class Assessment < ActiveRecord::Base
has_many :assessment_questions, dependent: :destroy
has_many :questions, through: :assessment_questions
end
In Questioni
class Question < ActiveRecord::Base
has_many :assessment_questions, dependent: :destroy
has_many :bank_questions, dependent: :destroy
end
In AssessmentQuestioni
class AssessmentQuestion < ActiveRecord::Base
belongs_to :question
belongs_to :assessment
end
Tableevaluation_questions has :assessment_id, :question_idand :markcolumns
I have an admin interface using ActiveAdmingem.
When creating ratings in the admin interface, in admin / evaluation.rb, I have a form generated by the gem format,
form do |f|
f.inputs do
f.input :name
f.input :duration
f.input :questions, as: :check_boxes, member_label: :id
f.input :creator_id
end
f.actions :commit
end

. , , - , , , , ( question.assessment_question.mark), .
, ,
undefined method `to_sym' for {:for=>:questions}:Hash
,
form do |f|
f.inputs do
f.input :name
f.input :duration
f.input for: :questions do | question |
f.input :question, as: :select
f.input question.assessment_question.mark
end
f.input :creator_id
end
f.actions :commit
end
?