app/views/answerer/_answers.html.haml in ask-0.2.0 vs app/views/answerer/_answers.html.haml in ask-0.3.0
- old
+ new
@@ -1,9 +1,11 @@
--answerer.all_questions.each do |question|
- -if(question.rhetorical?)
- %h3=question.name
- %p=question.instructions
- -else
- %dt=question.name
- -answerer.answers_to(question).each do |answer|
- -unless answer.answer.blank?
- %dd=answer.answer
+-raise 'You must pass in an "answerer" to use this partial' unless defined? answerer
+
+-answerer.questions_by_section.each do |section, questions|
+ -unless section.nil?
+ %h3= section.name
+ %p= section.instructions
+ %dl
+ -questions.each do |question|
+ %dt= question.name
+ -answerer.answers_to(question).each do |answer|
+ %dd= answer.answer