forked from External/greenlight
fix bug with single thumbnails erroring
This commit is contained in:
parent
a9892d2dcb
commit
fd2dc3abec
|
@ -127,6 +127,12 @@ class RoomsController < ApplicationController
|
||||||
end
|
end
|
||||||
helper_method :recording_length
|
helper_method :recording_length
|
||||||
|
|
||||||
|
# Prevents single images from erroring when not passed as an array.
|
||||||
|
def safe_recording_images(images)
|
||||||
|
Array.wrap(images)
|
||||||
|
end
|
||||||
|
helper_method :safe_recording_images
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def room_params
|
def room_params
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<td>
|
<td>
|
||||||
<% p = recording[:playbacks].find do |p| p[:type] == "presentation" end %>
|
<% p = recording[:playbacks].find do |p| p[:type] == "presentation" end %>
|
||||||
<% if p %>
|
<% if p %>
|
||||||
<% p[:preview][:images][:image].each do |img| %>
|
<% safe_recording_images(p[:preview][:images][:image]).each do |img| %>
|
||||||
<%= image_tag(img[:content].strip, class: "thumbnail px-2") %>
|
<%= image_tag(img[:content].strip, class: "thumbnail px-2") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in New Issue