app/inputs/day_type_input.rb
def input
    raise "#{attribute_name} is not an instance of Timetable::DaysOfWeek" unless days_of_week.is_a?(Timetable::DaysOfWeek)

    content = ''

    content << @builder.hidden_field(attribute_name, value: string_value, 'x-model': 'stringValue') # relevant data is coming from this field

    collection.each_with_index.map do |(value, label), index|
      content << template.content_tag(:div, class: 'lcbx-group-item') do
        template.content_tag(:div, class: 'checkbox') do
          template.content_tag(:label) do
            template.concat @builder.check_box(attribute_name, checkbox_options(value), value, value)
            template.concat template.content_tag(:span, label, class: 'lcbx-group-item-label')
          end
        end
      end
    end
    
    template.content_tag(
      :div,
      content.html_safe,
      class: 'form-group labelled-checkbox-group',
      'x-data':  "{
        stringValue: '#{string_value}',
        binaryValue: #{binary_value},
        isChecked(v) { return Boolean(v & this.binaryValue) }
        }",
      'x-init': "$watch('binaryValue', v => stringValue = v.toString(2).padStart(7, '0'))"
    )
  end
# We assume that is input will be used for week_days column type which is a custom representation of a 7 bits string.
# the relevant input is a hidden field that will send a 7 char string
# each time a checkbox is (un)checked we update the value of the hidden field 
We assume that is input will be used for week_days column type which is a custom representation of a 7 bits string.
the relevant input is a hidden field that will send a 7 char string
each time a checkbox is (un)checked we update the value of the hidden field
We assume that is input will be used for week_days column type which is a custom representation of a 7 bits string . the relevant input is a hidden field that will send a 7 char string each time a checkbox is ( un ) checked we update the value of the hidden field
def input
    raise "#{attribute_name} is not an instance of Timetable::DaysOfWeek" unless days_of_week.is_a?(Timetable::DaysOfWeek)
    content = ''
    content << @builder.hidden_field(attribute_name, value: string_value, 'x-model': 'stringValue') 
    collection.each_with_index.map do |(value, label), index|
      content << template.content_tag(:div, class: 'lcbx-group-item') do
        template.content_tag(:div, class: 'checkbox') do
          template.content_tag(:label) do
            template.concat @builder.check_box(attribute_name, checkbox_options(value), value, value)
            template.concat template.content_tag(:span, label, class: 'lcbx-group-item-label')
          end
        end
      end
    end
    template.content_tag(
      :div,
      content.html_safe,
      class: 'form-group labelled-checkbox-group',
      'x-data':  "{
        stringValue: '#{string_value}',
        binaryValue: #{binary_value},
        isChecked(v) { return Boolean(v & this.binaryValue) }
        }",
      'x-init': "$watch('binaryValue', v => stringValue = v.toString(2).padStart(7, '0'))"
    )
  end
def input raise "#{attribute_name} is not an instance of Timetable::DaysOfWeek" unless days_of_week . is_a? ( Timetable :: DaysOfWeek ) content = '' content << @builder . hidden_field ( attribute_name , value : string_value , 'x-model' : 'stringValue' ) collection . each_with_index . map do | ( value , label ) , index | content << template . content_tag ( :div , class : 'lcbx-group-item' ) do template . content_tag ( :div , class : 'checkbox' ) do template . content_tag ( :label ) do template . concat @builder . check_box ( attribute_name , checkbox_options ( value ) , value , value ) template . concat template . content_tag ( :span , label , class : 'lcbx-group-item-label' ) end end end end template . content_tag ( :div , content . html_safe , class : 'form-group labelled-checkbox-group' , 'x-data' : "{
        stringValue: '#{string_value}',
        binaryValue: #{binary_value},
        isChecked(v) { return Boolean(v & this.binaryValue) }
        }" , 'x-init' : "$watch('binaryValue', v => stringValue = v.toString(2).padStart(7, '0'))" ) end
We assume that is input will be used for week_days column type which is a custom representation of a 7 bits string.
We assume that is input will be used for week_days column type which is a custom representation of a 7 bits string .
# relevant data is coming from this field