diff --git a/app/helpers/participants_helper.rb b/app/helpers/participants_helper.rb index 7059f83..e4afa3a 100644 --- a/app/helpers/participants_helper.rb +++ b/app/helpers/participants_helper.rb @@ -1,2 +1,7 @@ module ParticipantsHelper -end + def mask_ssn(ssn) + return '' if ssn.blank? + + "*****#{ssn[-4..-1]}" + 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 ad2cbee..b1471eb 100644 --- a/app/views/participants/show.html.erb +++ b/app/views/participants/show.html.erb @@ -39,7 +39,7 @@
SSN: - <%= @participant.ssn %> + <%= mask_ssn(@participant.ssn) %>