Module: Decidim::Conferences::MediaAttachmentsHelper

Defined in:
decidim-conferences/app/helpers/decidim/conferences/media_attachments_helper.rb

Instance Method Summary collapse

Instance Method Details

#attachment_title(attachment) ⇒ Object

Renders the attachment's title. Checks if the attachment's title is translated or not and use the correct render method.

attachment - An Attachment object

Returns String.


24
25
26
# File 'decidim-conferences/app/helpers/decidim/conferences/media_attachments_helper.rb', line 24

def attachment_title(attachment)
  attachment.title.is_a?(Hash) ? translated_attribute(attachment.title) : attachment.title
end

#attachments_for_conference(attached_to) ⇒ Object

Renders the attachments of a Conference that includes the HasAttachments concern.

attached_to - The model to render the attachments from.

Returns nothing.


13
14
15
# File 'decidim-conferences/app/helpers/decidim/conferences/media_attachments_helper.rb', line 13

def attachments_for_conference(attached_to)
  render partial: "attachments", locals: { attached_to: attached_to }
end