demarches-normaliennes/app/components/editable_champ/annuaire_education_component.rb

18 lines
555 B
Ruby
Raw Normal View History

class EditableChamp::AnnuaireEducationComponent < EditableChamp::EditableChampBaseComponent
def dsfr_input_classname
'fr-select'
end
def react_props
react_input_opts(id: @champ.input_id,
class: "fr-mt-1w",
name: @form.field_name(:external_id),
selected_key: @champ.external_id,
items: @champ.selected_items,
loader: 'https://data.education.gouv.fr/api/records/1.0/search?dataset=fr-en-annuaire-education&rows=5',
coerce: 'AnnuaireEducation',
debounce: 500,
minimum_input_length: 5)
end
2022-08-12 10:45:04 +02:00
end