Updated all views so address ,'s only show for actual field entry

This commit is contained in:
Ben 2024-01-31 01:09:28 -06:00
parent a5a732b9cd
commit 778afeec08
6 changed files with 12 additions and 20 deletions

View File

@ -24,7 +24,7 @@
<tr>
<td><%= employer.first_name %></td>
<td><%= employer.last_name %></td>
<td><%= [employer.address_line_1, employer.address_line_2, employer.city, employer.state, employer.zip].compact.join(', ') %></td>
<td><%= [employer.address_line_1, employer.address_line_2, employer.city, employer.state, employer.zip].reject(&:blank?).join(', ') %></td>
<td><%= employer.phone %></td>
<td><%= employer.email %></td>
<td><%= employer.dob.strftime('%B %d, %Y') if employer.dob %></td>

View File

@ -12,7 +12,7 @@
<p class="card-text">
<strong>Address:</strong>
<%= [@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(', ') %>
</p>
<p class="card-text">

View File

@ -4,9 +4,8 @@
<div class="text-center mt-3">
<%= link_to 'New Participant', new_participant_path, class: 'btn btn-dark mb-3' %>
</div>
<%= paginate @participants %>
<%= paginate @participants %>
<table class="table table-striped table-hover">
<thead class="table-light">
@ -16,38 +15,31 @@
<th>Address</th>
<th>Phone</th>
<th>Email</th>
<th>Program</th>
<th>MCI</th>
<th>DOB</th>
<th colspan="3"></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% @participants.each do |participant| %>
<tr>
<td><%= participant.first_name %></td>
<td><%= participant.last_name %></td>
<td><%= participant.first_name %></td>
<td><%= participant.last_name %></td>
<td><%= [participant.address_line_1, participant.address_line_2, participant.city, participant.state, participant.zip].reject(&:blank?).join(', ') %></td>
<td><%= participant.phone %></td>
<td><%= participant.email %></td>
<td><%= participant.programs.map(&:name).join(", ") %></td>
<td><%= participant.mci %></td>
<td><%= participant.dob.strftime('%B %d, %Y') if participant.dob %></td>
<td>
<%= link_to participant, class: 'btn btn-sm btn-secondary' do %>
<i class="bi bi-eye"></i><!-- Eyeball icon for 'Show' -->
<i class="bi bi-eye"></i>
<% end %>
<%= link_to edit_participant_path(participant), class: 'btn btn-sm btn-info' do %>
<i class="bi bi-pencil-fill" style="color: white;"></i> <!-- Pencil icon for 'Edit' with white color -->
<% end %>
<i class="bi bi-pencil-fill" style="color: white;"></i>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@ -24,7 +24,7 @@
<% @vendors.each do |vendor| %>
<tr>
<td><%= vendor.name %></td>
<td><%= [vendor.address_line_1, vendor.address_line_2, vendor.city, vendor.state, vendor.zip].compact.join(', ') %></td>
<td><%= [vendor.address_line_1, vendor.address_line_2, vendor.city, vendor.state, vendor.zip].reject(&:blank?).join(', ') %></td>
<td><%= vendor.phone %></td>
<td><%= vendor.email %></td>
<td><%= vendor.dba %></td>

View File

@ -24,7 +24,7 @@
<tr>
<td><%= worker.first_name %></td>
<td><%= worker.last_name %></td>
<td><%= [worker.address_line_1, worker.address_line_2, worker.city, worker.state, worker.zip].compact.join(', ') %></td>
<td><%= [worker.address_line_1, worker.address_line_2, worker.city, worker.state, worker.zip].reject(&:blank?).join(', ') %></td>
<td><%= worker.phone %></td>
<td><%= worker.email %></td>
<td><%= worker.dob.strftime('%B %d, %Y') if worker.dob %></td>

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].reject(&:blank?).join(', ') %>
</p>
<p class="card-text">
<strong>Phone:</strong>