* Add comment for public controllers * Add block policy and specs * Add policy for authorizing dashboard * Add follow policy and specs * Refactor a tiny bit * Prevent banned users from following anything * Add a note for email sub controller about auth * Add image upload policies * Add policy for github repos * Fix typo and use correct github repo variable * Fix image uploader and use regular params * Add authenticate_user before action back in * Rename test * Update slack bot message formatting and fix reported URL
14 lines
373 B
Ruby
14 lines
373 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 = uploader.url
|
|
respond_to do |format|
|
|
format.json { render json: { link: link }, status: 200 }
|
|
end
|
|
end
|
|
end
|