Sha256: 3f7453c4ceb873775400abfaff6959f5059c5036cc006040b8f4b985d99e3100

Contents?: true

Size: 859 Bytes

Versions: 2

Compression:

Stored size: 859 Bytes

Contents

.checkbox_group.form-group{ class: "#{'has-error' if errors[question.code]}" }
  %label
    = question.question_text
    = ' *' if question.required
  = form.simple_fields_for :answers do |answer_form|
    - question.sub_questions.each do |sub_question|
      .checkbox
        %label
          - checked = (answers[sub_question.code].to_s == sub_question.value.to_s) if sub_question.value
          - checked ||= sub_question.preselected
          = answer_form.input_field sub_question.code, as:      :boolean,
                                                       value:   sub_question.value,
                                                       checked: checked,
                                                       class:   'form-control'
          = sub_question.text
  - if errors[question.code]
    .help-block.text-danger= errors[question.code]

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
helena-1.0.0.rc1 app/views/helena/questions/_checkbox_group.html.haml
helena-0.3.3 app/views/helena/questions/_checkbox_group.html.haml