From 769541b42b26a050e8a5e57b09bb6b2ddcf8e435 Mon Sep 17 00:00:00 2001 From: Jeremy Prevost Date: Tue, 12 Jul 2022 14:43:22 -0400 Subject: [PATCH] contentType is not a required field --- app/views/record/_record.html.erb | 10 ++++++---- app/views/search/_result.html.erb | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/views/record/_record.html.erb b/app/views/record/_record.html.erb index c985fdbe..62666a9f 100644 --- a/app/views/record/_record.html.erb +++ b/app/views/record/_record.html.erb @@ -11,10 +11,12 @@

- - <% # we need to create separate displays for different types of content types, see https://github.com/MITLibraries/bento/pull/908/files#diff-6718f9b88f6f93e59d8c2509512dc40a62088430ff3cce1165ab414565949415L22-L57 for starting point but we should anticipate wanting to expand to many more unique content types %> - Type <%= @record['contentType'].join %> - + <% if @record['contentType'].present? %> + + <% # we need to create separate displays for different types of content types, see https://github.com/MITLibraries/bento/pull/908/files#diff-6718f9b88f6f93e59d8c2509512dc40a62088430ff3cce1165ab414565949415L22-L57 for starting point but we should anticipate wanting to expand to many more unique content types %> + Type <%= @record['contentType'].join %> + + <% end %> <% if @record['citation'].present? %> diff --git a/app/views/search/_result.html.erb b/app/views/search/_result.html.erb index 84c75d6b..00ca5dec 100644 --- a/app/views/search/_result.html.erb +++ b/app/views/search/_result.html.erb @@ -4,7 +4,7 @@

- <%= result['contentType']&.each { |type| type['value'] }.join(' ; ') %> + <%= result['contentType']&.each { |type| type['value'] }&.join(' ; ') %> <% result['dates']&.each do |date| %> <%= date['value'] if date['kind'] == 'Publication date' %>