Class: Rapidfire::QuestionsController
Instance Method Summary
collapse
#authenticate_administrator!
Instance Method Details
#create ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'app/controllers/rapidfire/questions_controller.rb', line 19
def create
proxy_params = params[:question].merge(:question_group => @question_group)
@question = QuestionProxy.new(proxy_params)
@question.save
location = rapidfire.question_group_questions_path(@question_group)
respond_with(@question, location: location)
end
|
#destroy ⇒ Object
42
43
44
45
46
47
|
# File 'app/controllers/rapidfire/questions_controller.rb', line 42
def destroy
@question.destroy
location = rapidfire.question_group_questions_path(@question_group)
respond_with(@question, location: location)
end
|
#edit ⇒ Object
28
29
30
31
|
# File 'app/controllers/rapidfire/questions_controller.rb', line 28
def edit
@question = QuestionProxy.new(:question => @question)
respond_with(@question)
end
|
#index ⇒ Object
9
10
11
12
|
# File 'app/controllers/rapidfire/questions_controller.rb', line 9
def index
@questions = @question_group.questions
respond_with(@questions)
end
|
#new ⇒ Object
14
15
16
17
|
# File 'app/controllers/rapidfire/questions_controller.rb', line 14
def new
@question = QuestionProxy.new(:question_group => @question_group)
respond_with(@question)
end
|
#update ⇒ Object
33
34
35
36
37
38
39
40
|
# File 'app/controllers/rapidfire/questions_controller.rb', line 33
def update
proxy_params = params[:question].merge(:question => @question)
@question = QuestionProxy.new(proxy_params)
@question.save
location = rapidfire.question_group_questions_path(@question_group)
respond_with(@question, location: location)
end
|