Class: ScavengerHunt::SurveyQuestionsController

Inherits:
ApplicationController show all
Defined in:
lib/scavenger_hunt/app/controllers/scavenger_hunt/survey_questions_controller.rb

Instance Method Summary collapse

Instance Method Details

#answerObject



2
3
4
5
6
7
8
# File 'lib/scavenger_hunt/app/controllers/scavenger_hunt/survey_questions_controller.rb', line 2

def answer
  params[:answers].each do |id, answer|
    survey_question = ScavengerHunt::SurveyQuestion.find(id)
    survey_question.answer(current_player, answer)
  end
  redirect_to leaderboard_path
end

#indexObject



10
11
12
# File 'lib/scavenger_hunt/app/controllers/scavenger_hunt/survey_questions_controller.rb', line 10

def index
  @survey_questions = ScavengerHunt::SurveyQuestion.all
end