Class: Rapidfire::QuestionsController
Instance Method Summary
collapse
#authenticate_administrator!, #rapidfire_scoped
Instance Method Details
#create ⇒ Object
15
16
17
18
19
|
# File 'app/controllers/rapidfire/questions_controller.rb', line 15
def create
form_params = question_params.merge(:survey => @survey)
save_and_redirect(form_params, :new)
end
|
#destroy ⇒ Object
30
31
32
33
34
35
36
|
# File 'app/controllers/rapidfire/questions_controller.rb', line 30
def destroy
@question.destroy
respond_to do |format|
format.html { redirect_to index_location }
format.js
end
end
|
#edit ⇒ Object
21
22
23
|
# File 'app/controllers/rapidfire/questions_controller.rb', line 21
def edit
@question_form = QuestionForm.new(:question => @question)
end
|
#index ⇒ Object
7
8
9
|
# File 'app/controllers/rapidfire/questions_controller.rb', line 7
def index
@questions = @survey.questions
end
|
#new ⇒ Object
11
12
13
|
# File 'app/controllers/rapidfire/questions_controller.rb', line 11
def new
@question_form = QuestionForm.new(:survey => @survey)
end
|
#update ⇒ Object
25
26
27
28
|
# File 'app/controllers/rapidfire/questions_controller.rb', line 25
def update
form_params = question_params.merge(:question => @question)
save_and_redirect(form_params, :edit)
end
|