Participant Details

Name: <%= @participant.first_name %> <%= @participant.last_name %>

Address: <%= @participant.address %>

Phone: <%= @participant.phone %>

Email: <%= @participant.email %>

MCI: <%= @participant.mci %>

DOB: <%= @participant.dob.strftime('%B, %d, %Y') if @participant.dob.present? %>

SSN: <%= @participant.ssn %>

Gender: <%= @participant.gender %>

<%= link_to 'Edit', edit_participant_path(@participant), class: "btn btn-dark" %> <%= link_to 'Back to List', participants_path, class: "btn btn-secondary" %>

Linked Workers

<% @participant.employments.each do |employment| %> <% end %>
Worker Name Start Date End Date
<%= employment.worker.name %> <%= employment.start_date %> <%= employment.end_date %>
<%= form_with(url: link_worker_participant_path(@participant), method: :post) do |form| %>
<%= form.label :worker_id, "Select Worker" %> <%= form.collection_select :worker_id, Worker.all, :id, :name, include_blank: true %>
<%= form.label :start_date %> <%= form.date_field :start_date %>
<%= form.label :end_date %> <%= form.date_field :end_date %>
<%= form.submit "Link Worker" %> <% end %>