* Create alternate editor * Install linkstate (?) Not sure how it disappear in the first place * Run yarn install * Modulize ArticleForm component * Refactor * Isolating css WIP * Implement simplified frontmatter-less editor * Modulize individual form element * Ajust props names * Transform json params to snakecase * Remove codes * Update /new, almost there for release * Fix editor resize issues * Change defaultvalue to value in article form tag element * Modify html buttons in article form
18 lines
523 B
Ruby
18 lines
523 B
Ruby
class ImageUploadsController < ApplicationController
|
|
before_action :authenticate_user!
|
|
after_action :verify_authorized
|
|
|
|
def create
|
|
authorize :image_upload
|
|
uploader = ArticleImageUploader.new
|
|
uploader.store!(params[:image])
|
|
link = if params[:wrap_cloudinary]
|
|
ApplicationController.helpers.cloud_cover_url(uploader.url)
|
|
else
|
|
uploader.url
|
|
end
|
|
respond_to do |format|
|
|
format.json { render json: { link: link }, status: 200 }
|
|
end
|
|
end
|
|
end
|