Class: Brightcontent::AssetsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/brightcontent/assets_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



6
7
8
9
10
11
12
13
# File 'app/controllers/brightcontent/assets_controller.rb', line 6

def create
  @asset = Asset.new(params.slice(:attachable_id, :attachable_type, :asset))
  if @asset.save
    render json: @asset.to_json, status: :created
  else
    render json: @asset.errors, status: :unprocessable_entity
  end
end