Class: Admin::AttachmentSerializer

Inherits:
ActiveModel::Serializer
  • Object
show all
Includes:
PagesCore::AttachmentsHelper
Defined in:
app/serializers/admin/attachment_serializer.rb

Instance Method Summary collapse

Methods included from PagesCore::AttachmentsHelper

#attachment_path, #download_attachment_path, #page_file_path

Instance Method Details

#descriptionObject



13
14
15
# File 'app/serializers/admin/attachment_serializer.rb', line 13

def description
  localized_attribute(:description)
end

#nameObject



9
10
11
# File 'app/serializers/admin/attachment_serializer.rb', line 9

def name
  localized_attribute(:name)
end

#urlObject



17
18
19
# File 'app/serializers/admin/attachment_serializer.rb', line 17

def url
  attachment_path(object)
end