Edit Profile

Update your personal information, next of kin, and documents.

<%= form_with model: @customer, url: client_portal_profile_path, method: :patch, local: true do |f| %>
Personal Information
<%= f.label :firstname, class: "form-label" %> <%= f.text_field :firstname, class: "form-control rounded-pill" %>
<%= f.label :middlename, class: "form-label" %> <%= f.text_field :middlename, class: "form-control rounded-pill" %>
<%= f.label :lastname, class: "form-label" %> <%= f.text_field :lastname, class: "form-control rounded-pill" %>
<%= f.label :mobile_1, "Mobile 1", class: "form-label" %> <%= f.text_field :mobile_1, class: "form-control rounded-pill" %>
<%= f.label :mobile_2, "Mobile 2", class: "form-label" %> <%= f.text_field :mobile_2, class: "form-control rounded-pill" %>
<%= f.label :address_1, class: "form-label" %> <%= f.text_field :address_1, class: "form-control rounded-pill" %>
<%= f.label :address_2, class: "form-label" %> <%= f.text_field :address_2, class: "form-control rounded-pill" %>
<%= f.label :city, class: "form-label" %> <%= f.text_field :city, class: "form-control rounded-pill" %>
<%= f.label :country, class: "form-label" %> <%= f.text_field :country, class: "form-control rounded-pill" %>
Next of Kin
<%= link_to "Add Next of Kin", "#", class: "btn btn-outline-primary btn-sm rounded-pill" %>
<% f.fields_for :next_of_kins do |nok| %>
<%= nok.label :firstname, class: "form-label" %> <%= nok.text_field :firstname, class: "form-control rounded-pill" %>
<%= nok.label :lastname, class: "form-label" %> <%= nok.text_field :lastname, class: "form-control rounded-pill" %>
<%= nok.label :relation, class: "form-label" %> <%= nok.text_field :relation, class: "form-control rounded-pill" %>
<%= nok.label :mobile_1, class: "form-label" %> <%= nok.text_field :mobile_1, class: "form-control rounded-pill" %>
<%= nok.label :mobile_2, class: "form-label" %> <%= nok.text_field :mobile_2, class: "form-control rounded-pill" %>
<%= nok.label :email, class: "form-label" %> <%= nok.email_field :email, class: "form-control rounded-pill" %>
<%= nok.check_box :_destroy %> Remove
<% end %>
Upload Documents
<% @customer.documents.each do |doc| %>

<%= doc.title %>

<% if doc.file.attached? %> <%= link_to "⬇ Download", rails_blob_path(doc.file, disposition: "attachment"), class: "btn btn-outline-primary btn-sm" %> <% else %>

No file uploaded

<% end %>
<% end %> <%= f.fields_for :documents do |d| %>
<%= d.label :title, "Document Title", class: "form-label" %> <%= d.text_field :title, class: "form-control mb-2 rounded-pill" %> <%= d.label :file, "Upload File", class: "form-label" %> <%= d.file_field :file, class: "form-control rounded-pill" %>
<% end %>
<%= f.submit "Update Profile", data: {turbo: false}, class: "btn btn-primary btn-lg rounded-pill px-5" %> <%= link_to "Back to Dashboard", client_portal_dashboard_path, class: "btn btn-secondary btn-lg rounded-pill px-5 ms-2" %>
<% end %>
Security
Sensitive

Change your password. You’ll stay signed in on this device.

<%= form_with model: (@resource || current_user), url: user_registration_path, method: :patch, local: true, data: { turbo: false } do |f| %> <% if (@resource || current_user).errors.any? %>
<% (@resource || current_user).errors.full_messages.each do |msg| %>

<%= msg %>

<% end %>
<% end %>
<%= f.label :current_password, class: "form-label" %> <%= f.password_field :current_password, class: "form-control rounded-pill", autocomplete: "current-password", required: true %>
<%= f.label :password, "New password", class: "form-label" %> <%= f.password_field :password, class: "form-control rounded-pill", autocomplete: "new-password", required: true %>
<%= f.label :password_confirmation, class: "form-label" %> <%= f.password_field :password_confirmation, class: "form-control rounded-pill", autocomplete: "new-password", required: true %>
<%= f.submit "Update Password", class: "btn btn-outline-danger rounded-pill px-4" %>
<% end %>