Class: Rapidfire::QuestionGroupsController
Instance Method Summary
collapse
#authenticate_administrator!
Instance Method Details
#create ⇒ Object
17
18
19
20
21
22
|
# File 'app/controllers/rapidfire/question_groups_controller.rb', line 17
def create
@question_group = QuestionGroup.new(question_group_params)
@question_group.save
respond_with(@question_group, location: rapidfire.question_groups_url)
end
|
#destroy ⇒ Object
24
25
26
27
28
29
|
# File 'app/controllers/rapidfire/question_groups_controller.rb', line 24
def destroy
@question_group = QuestionGroup.find(params[:id])
@question_group.destroy
respond_with(@question_group)
end
|
#index ⇒ Object
7
8
9
10
|
# File 'app/controllers/rapidfire/question_groups_controller.rb', line 7
def index
@question_groups = QuestionGroup.all
respond_with(@question_groups)
end
|
#new ⇒ Object
12
13
14
15
|
# File 'app/controllers/rapidfire/question_groups_controller.rb', line 12
def new
@question_group = QuestionGroup.new
respond_with(@question_group)
end
|
#results ⇒ Object
31
32
33
34
35
36
37
|
# File 'app/controllers/rapidfire/question_groups_controller.rb', line 31
def results
@question_group = QuestionGroup.find(params[:id])
@question_group_results =
QuestionGroupResults.new(question_group: @question_group).
respond_with(@question_group_results, root: false)
end
|