From 778afeec08ed86e7d675c737d792e85f3ef0a0d1 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 31 Jan 2024 01:09:28 -0600 Subject: [PATCH] Updated all views so address ,'s only show for actual field entry --- app/views/employers/index.html.erb | 2 +- app/views/employers/show.html.erb | 2 +- app/views/participants/index.html.erb | 22 +++++++--------------- app/views/vendors/index.html.erb | 2 +- app/views/workers/index.html.erb | 2 +- app/views/workers/show.html.erb | 2 +- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/app/views/employers/index.html.erb b/app/views/employers/index.html.erb index 09db3d0..384fe2b 100644 --- a/app/views/employers/index.html.erb +++ b/app/views/employers/index.html.erb @@ -24,7 +24,7 @@ <%= employer.first_name %> <%= employer.last_name %> - <%= [employer.address_line_1, employer.address_line_2, employer.city, employer.state, employer.zip].compact.join(', ') %> + <%= [employer.address_line_1, employer.address_line_2, employer.city, employer.state, employer.zip].reject(&:blank?).join(', ') %> <%= employer.phone %> <%= employer.email %> <%= employer.dob.strftime('%B %d, %Y') if employer.dob %> diff --git a/app/views/employers/show.html.erb b/app/views/employers/show.html.erb index 5cab7a5..9cb942c 100644 --- a/app/views/employers/show.html.erb +++ b/app/views/employers/show.html.erb @@ -12,7 +12,7 @@

Address: - <%= [@employer.address_line_1, @employer.address_line_2, @employer.city, @employer.state, @employer.zip].compact.join(', ') %> + <%= [@employer.address_line_1, @employer.address_line_2, @employer.city, @employer.state, @employer.zip].reject(&:blank?).join(', ') %>

diff --git a/app/views/participants/index.html.erb b/app/views/participants/index.html.erb index b167300..673b309 100644 --- a/app/views/participants/index.html.erb +++ b/app/views/participants/index.html.erb @@ -4,9 +4,8 @@

<%= link_to 'New Participant', new_participant_path, class: 'btn btn-dark mb-3' %>
- - <%= paginate @participants %> + <%= paginate @participants %> @@ -16,38 +15,31 @@ - - - + <% @participants.each do |participant| %> - - + + - - - <% end %> -
Address Phone EmailProgramMCI DOBActions
<%= participant.first_name %><%= participant.last_name %><%= participant.first_name %><%= participant.last_name %> <%= [participant.address_line_1, participant.address_line_2, participant.city, participant.state, participant.zip].reject(&:blank?).join(', ') %> <%= participant.phone %> <%= participant.email %><%= participant.programs.map(&:name).join(", ") %><%= participant.mci %> <%= participant.dob.strftime('%B %d, %Y') if participant.dob %> <%= link_to participant, class: 'btn btn-sm btn-secondary' do %> - + <% end %> <%= link_to edit_participant_path(participant), class: 'btn btn-sm btn-info' do %> - - <% end %> + + <% end %>
- diff --git a/app/views/vendors/index.html.erb b/app/views/vendors/index.html.erb index 8594c4e..73f6753 100644 --- a/app/views/vendors/index.html.erb +++ b/app/views/vendors/index.html.erb @@ -24,7 +24,7 @@ <% @vendors.each do |vendor| %> <%= vendor.name %> - <%= [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(', ') %> <%= vendor.phone %> <%= vendor.email %> <%= vendor.dba %> diff --git a/app/views/workers/index.html.erb b/app/views/workers/index.html.erb index 40224ba..0f9daa9 100644 --- a/app/views/workers/index.html.erb +++ b/app/views/workers/index.html.erb @@ -24,7 +24,7 @@ <%= worker.first_name %> <%= worker.last_name %> - <%= [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].reject(&:blank?).join(', ') %> <%= worker.phone %> <%= worker.email %> <%= worker.dob.strftime('%B %d, %Y') if worker.dob %> diff --git a/app/views/workers/show.html.erb b/app/views/workers/show.html.erb index 05ac994..9d98e75 100644 --- a/app/views/workers/show.html.erb +++ b/app/views/workers/show.html.erb @@ -11,7 +11,7 @@

Address: - <%= [@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].reject(&:blank?).join(', ') %>

Phone: