Summary:

Admin users reviewing mentee applications can either promote users to the next stage or decline them. In either case, a new 'mentee_application_state' record will be created, which includes the admin’s user ID in a 'status_changed_by_id' field and a 'note' attribute. The objective of this feature is to enable administrators to input and save a note in the 'note' field for each application they review. Admins should be able to add notes from index and show page.

Proposal

Since the 'note' attribute will be included in the 'mentee_application_state' record, it's essential to include this field within the 'mentee_application_state' object before it is submitted. Currently, we use links to "promote" or "decline" applications. However, I propose replacing these links with a form. Utilizing a form will allow us to send an object that includes both the 'status_changed_by_id' and 'note' data fields. This feature could be efficiently implemented using a Turbo modal to enhance user experience

form

<%= form_with model: @user_mentee_application do |form| %>

    <%= form.label :decline, 'Decline' %>
    <%= form.check_box :decline %>

    <%= form.label :promote, 'Promote' %>
    <%= form.check_box :promote %>

    <%= form.label :note, 'Note' %>
    <%= form.text_area :note %>

	  <%= form.submit 'Submit' %>

 <%= end' %>