mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 05:04:35 +08:00
add tiny_mce controller
This commit is contained in:
parent
c25df63a14
commit
37be04c09c
1 changed files with 16 additions and 0 deletions
16
app/controllers/tiny_mce_assets_controller.rb
Normal file
16
app/controllers/tiny_mce_assets_controller.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
class TinyMceAssetsController < ApplicationController
|
||||
|
||||
def create
|
||||
step = Step.find_by_id(params[:step])
|
||||
image = Asset.create(file: params[:file],
|
||||
created_by: current_user,
|
||||
team: current_team)
|
||||
image.file.reprocess_without_delay!(:full)
|
||||
|
||||
render json: {
|
||||
image: {
|
||||
url: view_context.image_url(image.url(:full))
|
||||
}
|
||||
}, content_type: 'text/html'
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue