[Fix 3827] Champ Pays: la ligne de tirets ne devrait pas être selectionnable

This commit is contained in:
maatinito 2019-04-29 10:55:10 -10:00 committed by Pierre de La Morinerie
parent 748adfd3d5
commit 2308b3bc5c
2 changed files with 5 additions and 0 deletions

View file

@ -2,4 +2,8 @@ class Champs::PaysChamp < Champs::TextChamp
def self.pays def self.pays
ApiGeo::API.pays.pluck(:nom) ApiGeo::API.pays.pluck(:nom)
end end
def self.disabled_options
pays.select { |v| (v =~ /^--.*--$/).present? }
end
end end

View file

@ -1,4 +1,5 @@
= form.select :value, = form.select :value,
Champs::PaysChamp.pays, Champs::PaysChamp.pays,
disabled: Champs::PaysChamp.disabled_options,
include_blank: true, include_blank: true,
required: champ.mandatory? required: champ.mandatory?