[Fix 3827] Champ Pays: la ligne de tirets ne devrait pas être selectionnable
This commit is contained in:
parent
748adfd3d5
commit
2308b3bc5c
2 changed files with 5 additions and 0 deletions
|
@ -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
|
||||||
|
|
|
@ -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?
|
||||||
|
|
Loading…
Reference in a new issue