codeforamerica/michigan-benefits

View on GitHub
app/views/integrated/who_is_student/edit.html.erb

Summary

Maintainability
Test Coverage
<% content_for :header_title, "Students" %>

<% content_for :form_card_header do %>
    <h1 class="form-card__title tooltip" <%= tooltip_title "The Applicant should only need to provide detail for questions that are relevant. Using a screening question followed by a follow up question ensures they can move through the application more quickly." %>>
      Who is a college or vocational school student?
    </h1>
<% end %>

<% content_for :form_card_body do %>
    <%= fields_for(:form, @form, builder: MbFormBuilder) do |f| %>
        <fieldset class="input-group">
          <legend class="sr-only">
            Choose who is a student.
          </legend>
          <% @form.members.each do |member| %>
              <%= f.fields_for('members[]', member, hidden_field_id: true) do |ff| %>
                  <%= ff.mb_checkbox :student,
                    member.display_name,
                    options: {
                      checked_value: "yes",
                      unchecked_value: "no",
                    } %>
              <% end %>
          <% end %>
          <%= f.mb_form_errors :members %>
        </fieldset>
    <% end %>
<% end %>