11 lines
500 B
Ruby
11 lines
500 B
Ruby
json.id attachment.uuid
|
|
json.title attachment.title
|
|
json.description attachment.description
|
|
json.filesize number_to_human_size(attachment.filesize)
|
|
json.is_pdf attachment.is_pdf?
|
|
json.url attachment.is_pdf? ? download_url(attachment,disposition:"inline") : download_url(attachment)
|
|
json.created_on attachment.created_on.strftime("%Y-%m-%d %H:%M:%S")
|
|
json.content_type attachment.content_type
|
|
json.creator do
|
|
json.partial! "api/v1/users/simple_user", locals: {user: attachment.author}
|
|
end |