%form(action="#") -@form.questions.each do |question| -last_question = Question.new -if(question.rhetorical?) %h3.section =question.name %p.section.instructions =question.instructions -else -if question.name != last_question.name %dt =question_label(question) =question_instructions(question) -if question.required %strong{:style=>"color:red;"} * -case(question.type.to_sym) -when :TextQuestion %dd=text_field_tag(question.name.parameterize) -when :EssayQuestion %dd=text_area_tag(question.name.parameterize) -when :ChooseOneQuestion -if question.choices.count > 5 %dd=select_tag(question.name.parameterize, options_for_select((question.required ? [] : ['']) + question.choice_names)) -else -question.choices.each do |choice| %dd =radio_button_tag(question.name.parameterize, choice.name) =label_tag(question.name.parameterize, choice.name, :value=>choice.name) -when :ChecklistQuestion -question.choices.each do |choice| %dd =check_box_tag(question.name.parameterize, choice.name) =label_tag(question.name.parameterize, choice.name) -last_question = question