Class: Rapidfire::AttemptsController
Instance Method Summary
collapse
#authenticate_administrator!, #rapidfire_scoped
Instance Method Details
#create ⇒ Object
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/rapidfire/attempts_controller.rb', line 13
def create
@attempt_builder = AttemptBuilder.new(attempt_params)
if @attempt_builder.save
redirect_to after_answer_path_for
else
render :new
end
end
|
#edit ⇒ Object
23
24
25
|
# File 'app/controllers/rapidfire/attempts_controller.rb', line 23
def edit
@attempt_builder = AttemptBuilder.new(attempt_params)
end
|
#new ⇒ Object
9
10
11
|
# File 'app/controllers/rapidfire/attempts_controller.rb', line 9
def new
@attempt_builder = AttemptBuilder.new(attempt_params)
end
|
#show ⇒ Object
5
6
7
|
# File 'app/controllers/rapidfire/attempts_controller.rb', line 5
def show
@attempt = @survey.attempts.find_by(attempt_params_for_find)
end
|
#update ⇒ Object
27
28
29
30
31
32
33
34
35
|
# File 'app/controllers/rapidfire/attempts_controller.rb', line 27
def update
@attempt_builder = AttemptBuilder.new(attempt_params)
if @attempt_builder.save
redirect_to after_answer_path_for
else
render :edit
end
end
|