Sha256: 87128eda0f284b0af98ce3235fc833cf4c4df0974eb61dae7393bc54cc00a7a2
Contents?: true
Size: 411 Bytes
Versions: 2
Compression:
Stored size: 411 Bytes
Contents
class Cas::FileUploadsController < Cas::ApplicationController skip_before_action :authenticate_user! skip_before_action :verify_authenticity_token def create file = params.fetch(:file) uploader = ::FileUploader.new(:store) uploaded_file = uploader.upload(file) url = uploaded_file.url(public: true, host: ENV.fetch("CDN_HOST", nil)) render json: { location: url } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cas-cms-1.0.0.alpha2 | app/controllers/cas/file_uploads_controller.rb |
cas-cms-1.0.0.alpha1 | app/controllers/cas/file_uploads_controller.rb |