normalize page index

master^2
Pete Matsyburka 1 day ago
parent 1d169668f0
commit 5741bb4db2

@ -26,8 +26,9 @@ class PreviewDocumentPageController < ActionController::API
@template = attachment.record
preview_image = attachment.preview_images.joins(:blob)
.find_by(blob: { filename: ["#{params[:id]}.png", "#{params[:id]}.jpg"] })
preview_image =
attachment.preview_images.joins(:blob)
.find_by(blob: { filename: ["#{params[:id].to_i}.png", "#{params[:id].to_i}.jpg"] })
if preview_image
return redirect_to preview_image.url(time: ActiveStorage::Attachment.service_url_time),

Loading…
Cancel
Save