Sha256: 385f39385e1a46f818f1615476a4413a44bd6a2bba93509582c9f01894f3a543
Contents?: true
Size: 1.2 KB
Versions: 7
Compression:
Stored size: 1.2 KB
Contents
-last_question = Question.new =f.fields_for(:answers) do |a| -question = a.object.question -if(question.rhetorical?) %h3.section =question.name %p.section.instructions =question.instructions -else =a.hidden_field(:question_id, :value=>question.id) -if question.name != last_question.name %dt{:class => question.required?? 'required' : nil} =question_label(question, a) =question_instructions(question) -case(question.type.to_sym) -when :TextQuestion %dd=a.text_field(:answer) -when :EssayQuestion %dd=a.text_area(:answer) -when :ChooseOneQuestion -if question.choices.count > 5 %dd=a.collection_select(:answer, question.choice_names, :to_s, :to_s, :include_blank=>!question.required) -else -question.choices.each do |choice| %dd =a.radio_button(:answer, choice.name) =a.label(:answer, choice.name, :value=>choice.name) -when :ChecklistQuestion %dd =a.hidden_field(:choice_id, :value=>a.object.choice_id) =a.check_box(:answer, {}, a.object.choice.try(:name), '') =a.label(:answer, a.object.choice.try(:name)) -last_question = question
Version data entries
7 entries across 7 versions & 1 rubygems