Sha256: a96a045112436b0b146676cbb9837cf977cb43b995e03973cf606e9d53fbc267
Contents?: true
Size: 868 Bytes
Versions: 17
Compression:
Stored size: 868 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 Spotlight::Engine.config.iiif_service.info_url(@featured_image, request.host) 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
17 entries across 17 versions & 1 rubygems