Merge pull request #5388 from tchak/fix-patron

fix patron drop down list
This commit is contained in:
Kara Diaby 2020-07-17 14:55:37 +02:00 committed by GitHub
commit 21b200a260
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,15 +30,23 @@ class RootController < ApplicationController
.each { |champ| champ.type_de_champ.libelle = 'Un super titre de section' }
all_champs
.filter { |champ| [TypeDeChamp.type_champs.fetch(:drop_down_list), TypeDeChamp.type_champs.fetch(:multiple_drop_down_list)].include?(champ.type_champ) }
.filter { |champ| champ.type_de_champ.drop_down_list? }
.each do |champ|
champ.type_de_champ.drop_down_list = DropDownList.new(type_de_champ: champ.type_de_champ)
champ.drop_down_list.value =
"option A
option B
-- avant l'option C --
option C"
champ.value = '["option B", "option C"]'
if champ.type_de_champ.linked_drop_down_list?
champ.type_de_champ.drop_down_list_value =
"-- section 1 --
option A
option B
-- section 2 --
option C"
else
champ.type_de_champ.drop_down_list_value =
"option A
option B
-- avant l'option C --
option C"
champ.value = '["option B", "option C"]'
end
end
all_champs