Class: Hyrax::TinymceAssetsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/hyrax/tinymce_assets_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



3
4
5
6
7
8
9
10
11
12
# File 'app/controllers/hyrax/tinymce_assets_controller.rb', line 3

def create
  authorize! :create, TinymceAsset
  image = TinymceAsset.create params.permit(:file)

  render json: {
    image: {
      url: image.file.url
    }
  }, content_type: "text/html"
end