Sha256: 5d7cf65a8c0892a02ddaa7691355773f87127fd6c68803edb845a8ee4ce85458
Contents?: true
Size: 822 Bytes
Versions: 22
Compression:
Stored size: 822 Bytes
Contents
# frozen_string_literal: true module Spotlight # Handles requests to upload images for exhibit thumbnails class FeaturedImagesController < Spotlight::ApplicationController load_and_authorize_resource instance_name: :featured_image, class: 'Spotlight::TemporaryImage' def create if @featured_image.save && @featured_image.file_present? render json: { tilesource: tilesource, id: @featured_image.id } else render json: { error: 'unable to create image' }, status: :bad_request end end private def tilesource riiif.info_url(@featured_image) end # The create action can be called from a number of different forms, so # we normalize all the parameters. def create_params params.require(:featured_image).permit(:image) end end end
Version data entries
22 entries across 22 versions & 1 rubygems