Sha256: 58bd845e51126a702af46463e8d8f720c71f252f67d9ac9063884d37dc064925

Contents?: true

Size: 411 Bytes

Versions: 4

Compression:

Stored size: 411 Bytes

Contents

class Cas::FileUploadsController < Cas::ApplicationController
  skip_before_action :authenticate_user!
  skip_before_filter :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

4 entries across 4 versions & 1 rubygems

Version Path
cas-cms-0.1.3 app/controllers/cas/file_uploads_controller.rb
cas-cms-0.1.2 app/controllers/cas/file_uploads_controller.rb
cas-cms-0.1.1 app/controllers/cas/file_uploads_controller.rb
cas-cms-0.1.0 app/controllers/cas/file_uploads_controller.rb