diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index e17cbc00c..c4ff759fb 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -21,4 +21,13 @@ module WelcomeHelper end end + def render_image(recommended, image_field, image_version, image_default) + image_path = if image_field.present? && image_version.present? + recommended.send("#{image_field}", image_version) + elsif image_default.present? + image_default + end + image_tag(image_path) if image_path.present? + end + end diff --git a/app/views/welcome/_recommended_carousel.html.erb b/app/views/welcome/_recommended_carousel.html.erb index e552ea01e..2b1f891d3 100644 --- a/app/views/welcome/_recommended_carousel.html.erb +++ b/app/views/welcome/_recommended_carousel.html.erb @@ -9,6 +9,7 @@ <% recommendeds.each_with_index do |recommended, index| %>