quests_controller.rb 535 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# encoding: UTF-8
#
class QuestsController < ApplicationController


  before_filter :set_hacker, :only => [:solve]
  before_filter :set_quest,  :only => [:solve]


  ######################
  ##  Member Methods  ##
  ######################

  def solve
    @quest.solve(hacker, current_user)
  end


  #################
  ##  Protected  ##
  #################

  protected

  def set_quest
    @quest = Quest.find(params[:id])
  end # #set_quest

  def set_hacker
    @hacker = Hacker.find(params[:hacker_id])
  end # #set_hacker

end