Class: ScavengerHunt::AnswersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ScavengerHunt::AnswersController
- Defined in:
- lib/scavenger_hunt/app/controllers/scavenger_hunt/answers_controller.rb
Instance Method Summary collapse
- #correct ⇒ Object
- #create ⇒ Object
- #new ⇒ Object (also: #incorrect)
Instance Method Details
#correct ⇒ Object
5 6 |
# File 'lib/scavenger_hunt/app/controllers/scavenger_hunt/answers_controller.rb', line 5 def correct end |
#create ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/scavenger_hunt/app/controllers/scavenger_hunt/answers_controller.rb', line 8 def create @answer = @clue.answers.create!(answer: answer_param) if @answer.valid? && @answer.is_correct? if @game.finished? redirect_to finish_game_path(@game, confirm: true) else redirect_to correct_game_clue_answer_path end else redirect_to incorrect_game_clue_answer_path end end |
#new ⇒ Object Also known as: incorrect
22 23 24 |
# File 'lib/scavenger_hunt/app/controllers/scavenger_hunt/answers_controller.rb', line 22 def new @answer = @clue.answers.new end |