Class: Uploadbox::ImagesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Uploadbox::ImagesController
- Defined in:
- app/controllers/uploadbox/images_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'app/controllers/uploadbox/images_controller.rb', line 5 def create if Uploadbox.background_processing Resque.enqueue(ProcessImage, image_params) else Image.create_upload(image_params) end render nothing: true end |
#destroy ⇒ Object
21 22 23 |
# File 'app/controllers/uploadbox/images_controller.rb', line 21 def destroy render json: Image.find(params[:id]).destroy end |
#find ⇒ Object
14 15 16 17 18 19 |
# File 'app/controllers/uploadbox/images_controller.rb', line 14 def find params[:imageable_type].constantize # load class upload_class_name = params[:imageable_type] + params[:upload_name].camelize @image = Uploadbox.const_get(upload_class_name).find_by(secure_random: params[:secure_random]) end |