From 12352ef69d953c358a84ab2789f4d3187e046c79 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 30 Jan 2024 17:11:13 -0600 Subject: [PATCH] Updated Edit Employment view to be in line with our app --- app/views/employments/edit.html.erb | 54 ++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/app/views/employments/edit.html.erb b/app/views/employments/edit.html.erb index 4486de5..c6da03c 100644 --- a/app/views/employments/edit.html.erb +++ b/app/views/employments/edit.html.erb @@ -1,19 +1,39 @@ -

Edit Employment

+
+
+
+

Edit Employment

-<%= form_with(model: @employment, url: employment_path(@employment), method: :patch) do |form| %> -
- <%= form.label :start_date %> - <%= form.date_field :start_date %> + <%= form_with(model: @employment, url: employment_path(@employment), method: :patch, local: true, html: { class: 'needs-validation', novalidate: true }) do |form| %> + <% if @employment.errors.any? %> + + <% end %> + +
+ <%= form.label :start_date, class: 'form-label' %> + <%= form.date_field :start_date, class: 'form-control' %> +
+ +
+ <%= form.label :end_date, class: 'form-label' %> + <%= form.date_field :end_date, class: 'form-control' %> +
+ +
+ <%= form.submit "Update Employment", class: 'btn btn-dark' %> +
+ <% end %> + +
+ <%= link_to 'Back to Participant', participant_path(@employment.participant), class: 'btn btn-secondary' %> + <%= link_to 'Delete Employment', employment_path(@employment), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %> +
+
- -
- <%= form.label :end_date %> - <%= form.date_field :end_date %> -
- - <%= form.submit "Update Employment" %> -<% end %> - -<%= link_to 'Delete Employment', employment_path(@employment), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %> - -<%= link_to 'Back to Participant', participant_path(@employment.participant), class: 'btn btn-secondary' %> +