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

14 lines
331 B
Ruby
Raw Normal View History

class EditableChamp::RegionsComponent < EditableChamp::EditableChampBaseComponent
2022-08-12 10:45:04 +02:00
include ApplicationHelper
private
def options
APIGeoService.regions.map { [_1[:name], _1[:code]] }
end
def select_options
{ selected: @champ.selected }.merge(@champ.mandatory? ? { prompt: '' } : { include_blank: '' })
end
2022-08-12 10:45:04 +02:00
end