User new direct uploads controllers action on imageable.

This commit is contained in:
Senén Rodero Rodríguez
2017-09-19 12:00:59 +02:00
parent 824dd26d5a
commit 966ff4dc03
19 changed files with 225 additions and 135 deletions

View File

@@ -18,8 +18,7 @@ class DirectUploadsController < ApplicationController
render json: { cached_attachment: @direct_upload.relation.cached_attachment,
filename: @direct_upload.relation.attachment.original_filename,
destroy_link: render_destroy_upload_link(@direct_upload).html_safe,
attachment_url: @direct_upload.relation.attachment.url,
is_image: Image::ACCEPTED_CONTENT_TYPE.include?(@direct_upload.relation.attachment_content_type)
attachment_url: @direct_upload.relation.attachment.url
}
else
@direct_upload.destroy_attachment