Add Attachment Video

This commit is contained in:
sylor_huang@126.com 2020-09-24 14:57:36 +08:00
parent 116356c284
commit e698efb14f
2 changed files with 2 additions and 1 deletions

View File

@ -385,7 +385,7 @@ class ApplicationController < ActionController::Base
def current_user def current_user
if Rails.env.development? if Rails.env.development?
User.current = User.find 36480 User.current = User.find 1
else else
User.current User.current
end end

View File

@ -3,6 +3,7 @@ json.title attachment.title
json.filesize number_to_human_size attachment.filesize json.filesize number_to_human_size attachment.filesize
json.description attachment.description json.description attachment.description
json.is_pdf attachment.is_pdf? json.is_pdf attachment.is_pdf?
json.absolute_path absolute_path(local_path(attachment))
json.url attachment.is_pdf? ? download_url(attachment,disposition:"inline") : download_url(attachment) json.url attachment.is_pdf? ? download_url(attachment,disposition:"inline") : download_url(attachment)
# json.url download_url(attachment) # json.url download_url(attachment)
json.set! :delete, delete.nil? ? true : delete if defined? delete json.set! :delete, delete.nil? ? true : delete if defined? delete