mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-16 13:14:03 +00:00
Do not require answers if it is a yes or no question.
This commit is contained in:
parent
2c98ba9711
commit
bcde6b300c
2 changed files with 17 additions and 1 deletions
|
|
@ -20,6 +20,10 @@ module Admin
|
|||
@question.conference_id = @conference.id
|
||||
authorize! :create, @question
|
||||
|
||||
if @question.question_type_id == QuestionType.find_by(title: 'Yes/No').id
|
||||
@question.answers = [Answer.find_by(title: 'Yes'), Answer.find_by(title: 'No')]
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
if @conference.save
|
||||
format.html { redirect_to admin_conference_questions_path, notice: 'Question was successfully created.' }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue