app/helpers/questionnaires_helper.rb
# render new answer form template.
# "form" is answer_responder form
render new answer form template.
"form" is answer_responder form
render new answer form template . " form " is answer_responder form
def render_answer_form(form, question_entity)
    prefix  = prefix_for_form(form) + "[answers]"
    answer  = form.object.build_answers  
    answer.questionnaire_run_id = question_entity.run_id 
    options = question_entity.options_from_question
    case question_entity.question_type
      when Questionnaire::Free_Form_Type
        render :partial => "answers/textarea_answering",
               :locals   => {:answer => answer, :prefix => prefix}
      when Questionnaire::Single_Choice_Type
       render :partial => "answers/radio_answering",
               :locals   => {:answer => answer, :prefix => prefix, :options => options}
      when Questionnaire::Multiple_Choice_Type
        render :partial => "answers/checkbox_answering",
               :locals   => {:answer => answer, :prefix => prefix, :options => options}
    end    
  end
def render_answer_form ( form , question_entity ) prefix = prefix_for_form ( form ) + "[answers]" answer = form . object . build_answers answer . questionnaire_run_id = question_entity . run_id options = question_entity . options_from_question case question_entity . question_type when Questionnaire :: Free_Form_Type render :partial => "answers/textarea_answering" , :locals => { :answer => answer , :prefix => prefix } when Questionnaire :: Single_Choice_Type render :partial => "answers/radio_answering" , :locals => { :answer => answer , :prefix => prefix , :options => options } when Questionnaire :: Multiple_Choice_Type render :partial => "answers/checkbox_answering" , :locals => { :answer => answer , :prefix => prefix , :options => options } end end
render new answer form template.
render new answer form template .
# answer belonging to answer_responder(form.object) # answer also belongs to question_entity
form
<not_specific>
question_entity
<not_specific>