introduce check_other and radio_other question types
completes issue #48
This commit is contained in:
@ -51,6 +51,7 @@ class QuizController < ApplicationController
|
||||
:radio,
|
||||
:text,
|
||||
checkbox: [],
|
||||
with_other: [:other, options: []],
|
||||
live_code: [:later, :html, :css, :js, :text]
|
||||
)
|
||||
end
|
||||
@ -110,4 +111,11 @@ class QuizController < ApplicationController
|
||||
saved: params.key?(:save),
|
||||
submitted: params.key?(:submit))
|
||||
end
|
||||
|
||||
def process_radio_other
|
||||
@answer.update(answer: answer_params[:with_other].to_h,
|
||||
saved: params.key?(:save),
|
||||
submitted: params.key?(:submit))
|
||||
end
|
||||
alias process_checkbox_other process_radio_other
|
||||
end
|
||||
|
Reference in New Issue
Block a user