Class: GacoCms::Admin::BaseController

Inherits:
GacoCms::AdminController show all
Defined in:
app/controllers/gaco_cms/admin/base_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



17
# File 'app/controllers/gaco_cms/admin/base_controller.rb', line 17

def index; end

#upload_fileObject



8
9
10
11
12
13
14
15
# File 'app/controllers/gaco_cms/admin/base_controller.rb', line 8

def upload_file
  file = GacoCms::MediaFile.new(file: params[:file])
  if file.save
    render json: { location: file.url }
  else
    render json: { error: file.errors.full_message.join(', ') }
  end
end