Sha256: aac8604c793c67ec38ea7eafb226aa8caf06ff9fed4bd997e34d16a61118eddb
Contents?: true
Size: 576 Bytes
Versions: 6
Compression:
Stored size: 576 Bytes
Contents
# frozen_string_literal: true module Koi module SummaryList class AttachmentComponent < Base def initialize(model, attribute, variant: :thumb, **attributes) super(model, attribute, **attributes) @variant = variant end def attribute_value if raw_value.try(:representable?) image_tag(@variant.nil? ? raw_value : raw_value.variant(@variant)) elsif raw_value.try(:attached?) link_to raw_value.blob.filename, rails_blob_path(raw_value, disposition: :attachment) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems