[#1421] Move pays to PaysChamp
This commit is contained in:
parent
0239f936d7
commit
e99931527b
4 changed files with 5 additions and 6 deletions
|
@ -19,10 +19,6 @@ class Champ < ApplicationRecord
|
|||
mandatory? && value.blank?
|
||||
end
|
||||
|
||||
def self.pays
|
||||
JSON.parse(Carto::GeoAPI::Driver.pays).pluck("nom")
|
||||
end
|
||||
|
||||
def to_s
|
||||
if value.present?
|
||||
string_value
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
class Champs::PaysChamp < Champs::TextChamp
|
||||
def self.pays
|
||||
JSON.parse(Carto::GeoAPI::Driver.pays).pluck("nom")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
= form.select :value,
|
||||
Champ.pays,
|
||||
Champs::PaysChamp.pays,
|
||||
required: champ.mandatory?
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
= select_tag("champs['#{champ.id}']",
|
||||
options_for_select(Champ.pays, selected: champ.object.value))
|
||||
options_for_select(Champs::PaysChamp.pays, selected: champ.object.value))
|
||||
|
|
Loading…
Reference in a new issue