From a5a732b9cd9c72e5a71d49e6694df25ed5d50c24 Mon Sep 17 00:00:00 2001
From: Ben
Date: Wed, 31 Jan 2024 00:49:23 -0600
Subject: [PATCH] Fixed the Vendor Module to reflect the address update and
edited the styling to keep it consistent with current modules.
---
app/controllers/vendors_controller.rb | 19 ++++++++++++++++---
app/views/participants/show.html.erb | 2 +-
app/views/vendors/edit.html.erb | 1 -
app/views/vendors/show.html.erb | 4 ++--
4 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/app/controllers/vendors_controller.rb b/app/controllers/vendors_controller.rb
index 8d7cbcc..8017e57 100644
--- a/app/controllers/vendors_controller.rb
+++ b/app/controllers/vendors_controller.rb
@@ -40,8 +40,21 @@ class VendorsController < ApplicationController
end
private
- def vendor_params
- params.require(:vendor).permit(:name, :address, :phone, :email, :dba, :tin, :contact)
- end
+ def vendor_params
+ params.require(:vendor).permit(
+ :name,
+ :address_line_1,
+ :address_line_2,
+ :city,
+ :state,
+ :zip,
+ :phone,
+ :email,
+ :dba,
+ :tin,
+ :contact
+ )
+ end
+
end
\ No newline at end of file
diff --git a/app/views/participants/show.html.erb b/app/views/participants/show.html.erb
index b1471eb..ad2cbee 100644
--- a/app/views/participants/show.html.erb
+++ b/app/views/participants/show.html.erb
@@ -39,7 +39,7 @@
SSN:
- <%= mask_ssn(@participant.ssn) %>
+ <%= @participant.ssn %>
diff --git a/app/views/vendors/edit.html.erb b/app/views/vendors/edit.html.erb
index 7b14f40..69cd073 100644
--- a/app/views/vendors/edit.html.erb
+++ b/app/views/vendors/edit.html.erb
@@ -6,7 +6,6 @@
<%= render 'form', vendor: @vendor %>
- <%= 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" %>
diff --git a/app/views/vendors/show.html.erb b/app/views/vendors/show.html.erb
index 5622aa7..67237ac 100644
--- a/app/views/vendors/show.html.erb
+++ b/app/views/vendors/show.html.erb
@@ -11,7 +11,7 @@
Address:
- <%= [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(', ') %>
Phone:
@@ -37,7 +37,7 @@
- <%= 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" %>