Class: Papercat::Api::ImagesController

Inherits:
Papercat::ApplicationController show all
Defined in:
app/controllers/papercat/api/images_controller.rb

Instance Method Summary collapse

Methods inherited from Papercat::ApplicationController

#admin

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
# File 'app/controllers/papercat/api/images_controller.rb', line 10

def create
  @record = Image.new(file: params[:file])
  if @record.save
    render(json: @record.as_json)
  else
    render(json: @record.errors)
  end
end