Sha256: 5a8b02aa9a50053ab9bd7bd8a9839fe1eeca8bc913c1dcafbc1b4b51488803a0
Contents?: true
Size: 519 Bytes
Versions: 8
Compression:
Stored size: 519 Bytes
Contents
# frozen_string_literal: true require_dependency 'c/admin_controller' module C class Admin::ImagesController < AdminController load_and_authorize_resource class: C::Image def create # Take upload from params[:file] and store it somehow... # Optionally also accept params[:hint] and consume if needed image = C::Image.create!(image: params[:file]) render json: { image: { url: image.image.url } }, content_type: 'text/html' end end end
Version data entries
8 entries across 8 versions & 1 rubygems