demarches-normaliennes/app/helpers/zone_helper.rb
2021-12-15 19:37:32 +01:00

9 lines
341 B
Ruby

module ZoneHelper
def grouped_options_for_zone
collectivite = Zone.find_by(acronym: "COLLECTIVITE")
{
"--" => [[I18n.t('i_dont_know', scope: 'utils'), nil], [collectivite.label, collectivite.id]],
I18n.t('ministeres', scope: 'zones') => (Zone.order(:label) - [collectivite]).map { |m| [m.label, m.id] }
}
end
end