Fixed the Vendor Module to reflect the address update and edited the styling to keep it consistent with current modules.

This commit is contained in:
Ben 2024-01-31 00:49:23 -06:00
parent 12352ef69d
commit a5a732b9cd
4 changed files with 19 additions and 7 deletions

View File

@ -41,7 +41,20 @@ class VendorsController < ApplicationController
private
def vendor_params
params.require(:vendor).permit(:name, :address, :phone, :email, :dba, :tin, :contact)
end
params.require(:vendor).permit(
:name,
:address_line_1,
:address_line_2,
:city,
:state,
:zip,
:phone,
:email,
:dba,
:tin,
:contact
)
end
end

View File

@ -39,7 +39,7 @@
<p class="card-text">
<strong>SSN:</strong>
<%= mask_ssn(@participant.ssn) %>
<%= @participant.ssn %>
</p>
<p class="card-text">

View File

@ -6,7 +6,6 @@
<%= render 'form', vendor: @vendor %>
<div class="mt-3 d-flex justify-content-between">
<%= link_to 'Cancel', vendor_path(@vendor), class: "btn btn-warning" %>
<%= link_to 'Back to List', vendors_path, class: "btn btn-secondary" %>
<%= link_to 'Delete', @vendor, 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>
<%= [vendor.address_line_1, vendor.address_line_2, vendor.city, vendor.state, vendor.zip].compact.join(', ') %>
<%= [@vendor.address_line_1, @vendor.address_line_2, @vendor.city, @vendor.state, @vendor.zip].reject(&:blank?).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_vendor_path(@vendor), class: "btn btn-primary" %>
<%= link_to 'Edit', edit_vendor_path(@vendor), class: "btn btn-dark" %>
<%= link_to 'Back to List', vendors_path, class: "btn btn-secondary" %>
</div>
</div>