Worker Module updated and fixed to include proper styling and page views

This commit is contained in:
Ben 2024-01-30 17:02:46 -06:00
parent ef63a37371
commit daa563f31a
3 changed files with 10 additions and 6 deletions

View File

@ -52,9 +52,14 @@ class WorkersController < ApplicationController
end
private
def worker_params
params.require(:worker).permit(:first_name, :last_name, :address, :phone, :email, :dob, :ssn, :gender)
end
def worker_params
params.require(:worker).permit(
:first_name, :last_name,
:address_line_1, :address_line_2, :city, :state, :zip,
:phone, :email, :dob, :ssn, :gender
)
end
end

View File

@ -6,7 +6,6 @@
<%= render 'form', worker: @worker %>
<div class="mt-3 d-flex justify-content-between">
<%= link_to 'Cancel', worker_path(@worker), class: "btn btn-warning" %>
<%= link_to 'Back to List', workers_path, class: "btn btn-secondary" %>
<%= link_to 'Delete', @worker, method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-danger" %>
</div>

View File

@ -11,7 +11,7 @@
</p>
<p class="card-text">
<strong>Address:</strong>
<%= [worker.address_line_1, worker.address_line_2, worker.city, worker.state, worker.zip].compact.join(', ') %>
<%= [@worker.address_line_1, @worker.address_line_2, @worker.city, @worker.state, @worker.zip].compact.join(', ') %>
</p>
<p class="card-text">
<strong>Phone:</strong>
@ -37,7 +37,7 @@
</div>
<div class="mt-3 d-flex justify-content-between">
<%= link_to 'Edit', edit_worker_path(@worker), class: "btn btn-primary" %>
<%= link_to 'Edit', edit_worker_path(@worker), class: "btn btn-dark" %>
<%= link_to 'Back to List', workers_path, class: "btn btn-secondary" %>
</div>
</div>