<%= form_for(@membership, url: url, html: { role: :form }) do |f| %> <% if @membership.errors.any? %> <% end %> <% if @participant.errors.any? %> <% end %>

Participant: <%= @participant.study_id %>

<%= f.label :group_id %> <% if @membership.new_record? %> <%= f.select :group_id, grouped_options_for_select(@group_options, @membership.group_id), { prompt: "Select Group" }, { class: "form-control" } %> <% else %> <%= @membership.group.title %> <% end %>
<% if social_features? && (@membership.new_record? || @membership.group.arm.social?) %>
<%= f.label :display_name, "Display Name" %> <%= f.text_field :display_name, class: "form-control", value: @participant.display_name %>

Only necessary for enrollments where socializing is a feature of the arm.

<% end %> <%= render "dates", membership: @membership %> <%= f.submit button_text, class: "btn btn-primary" %> <%= link_to "Cancel", cancel_path, class: "btn btn-default" %> <% end %>