Module: Perth::Librarian::AttachmentsHelper

Defined in:
app/helpers/perth/librarian/attachments_helper.rb

Instance Method Summary collapse

Instance Method Details

#attachable_show_column(record, _column) ⇒ Object


23
24
25
26
27
# File 'app/helpers/perth/librarian/attachments_helper.rb', line 23

def attachable_show_column(record, _column)
  href = polymorphic_path([:librarian, record.attachable])
  text = record.attachable.name
  link_to(text, href)
end

#data_blake2b_hexdigest_show_column(record, _column) ⇒ Object


30
31
32
33
34
# File 'app/helpers/perth/librarian/attachments_helper.rb', line 30

def data_blake2b_hexdigest_show_column(record, _column)
  href = hexdigest_librarian_attachment_path(record, format: :blake2b)
  text = record.data_blake2b_hexdigest
  link_to(text, href)
end

#data_sha512_hexdigest_show_column(record, _column) ⇒ Object


37
38
39
40
41
# File 'app/helpers/perth/librarian/attachments_helper.rb', line 37

def data_sha512_hexdigest_show_column(record, _column)
  href = hexdigest_librarian_attachment_path(record, format: :sha512)
  text = record.data_sha512_hexdigest
  link_to(text, href)
end