From 6e948929eaae2dea923717f3a6ef9f1a2cbb0bf6 Mon Sep 17 00:00:00 2001 From: Keith Bennett Date: Tue, 30 Jul 2019 12:21:53 -0400 Subject: [PATCH] #156 Added "Not Provided" for fields with missing information. (#158) * #156 Added "Not Provided" for fields with missing information. * Use instance variable so that 'Not Provided' is defined only once, to prevent misspelling and simplify modification. * Use Rails internationalization for string "Not Provided". * Removed @not_provided variable assignment no longer needed. --- app/views/partners/show.html.erb | 26 +++++++++++++------------- config/locales/en.yml | 1 + 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/views/partners/show.html.erb b/app/views/partners/show.html.erb index e7d4548e..89e547a2 100644 --- a/app/views/partners/show.html.erb +++ b/app/views/partners/show.html.erb @@ -207,48 +207,48 @@
Ethnic Composition of Those Served
African American
-
<%= @partner.population_black %>
+
<%= @partner.population_black || t(:not_provided) %>
Caucasian
-
<%= @partner.population_white %>
+
<%= @partner.population_white || t(:not_provided) %>
Hispanic
-
<%= @partner.population_hispanic %>
+
<%= @partner.population_hispanic || t(:not_provided) %>
Asian
-
<%= @partner.population_asian %>
+
<%= @partner.population_asian || t(:not_provided) %>
American Indian
-
<%= @partner.population_american_indian %>
+
<%= @partner.population_american_indian || t(:not_provided) %>
Pacific Islander
-
<%= @partner.population_island %>
+
<%= @partner.population_island || t(:not_provided) %>
Multi-racial
-
<%= @partner.population_multi_racial %>
+
<%= @partner.population_multi_racial || t(:not_provided) %>
Other
-
<%= @partner.population_other %>
+
<%= @partner.population_other || t(:not_provided) %>
Zip Codes Served
<%= @partner.zips_served %>
Poverty Information of Those Served
At FPL or below
-
<%= @partner.at_fpl_or_below %>
+
<%= @partner.at_fpl_or_below || t(:not_provided) %>
Above 1-2 times FPL
-
<%= @partner.above_1_2_times_fpl %>
+
<%= @partner.above_1_2_times_fpl || t(:not_provided) %>
Greater than 2 times FPL
-
<%= @partner.greater_2_times_fpl %>
+
<%= @partner.greater_2_times_fpl || t(:not_provided) %>
Poverty Unknown
-
<%= @partner.poverty_unknown %>
+
<%= @partner.poverty_unknown || t(:not_provided) %>
Ages Served
Ages
-
<%= @partner.ages_served %>
+
<%= @partner.ages_served || t(:not_provided) %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 2c5c77fa..c0e46007 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -30,6 +30,7 @@ # available at http://guides.rubyonrails.org/i18n.html. en: + not_provided: "Not Provided" hello: "Hello world" :true: 'Yes' :false: 'No'