demarches-normaliennes/app/models/champs/yes_no_champ.rb

28 lines
491 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class Champs::YesNoChamp < Champs::BooleanChamp
2023-07-03 11:16:49 +02:00
def legend_label?
true
end
def html_label?
false
end
def yes_input_id
"#{input_id}-yes"
end
def no_input_id
"#{input_id}-no"
end
def focusable_input_id
yes_input_id
end
def self.options
[[I18n.t('activerecord.attributes.type_de_champ.type_champs.yes_no_true'), true], [I18n.t('activerecord.attributes.type_de_champ.type_champs.yes_no_false'), false]]
end
2018-02-13 18:18:20 +01:00
end