%= form_for(@membership, url: url, html: { role: :form }) do |f| %>
<% if @membership.errors.any? %>
<%= pluralize(@membership.errors.count, "error") %> prohibited this group from being assigned to this participant:
<% @membership.errors.full_messages.each do |message| %>
- <%= message %>
<% end %>
<% end %>
<% if @participant.errors.any? %>
<%= pluralize(@participant.errors.count, "error") %> prohibited this participant from being updated:
<% @participant.errors.full_messages.each do |message| %>
- <%= message %>
<% end %>
<% 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?) %>
<% end %>
<%= render "dates", membership: @membership %>
<%= f.submit button_text, class: "btn btn-primary" %>
<%= link_to "Cancel", cancel_path, class: "btn btn-default" %>
<% end %>