Sha256: 2cc598c6cc342078b0f9f81c75e14fefcda539db81ff2bdd4a484211e1a2e819

Contents?: true

Size: 599 Bytes

Versions: 16

Compression:

Stored size: 599 Bytes

Contents

module Plutonium
  module Core
    module Fields
      module Renderers
        class AttachmentRenderer < BasicRenderer
          attr_reader :reflection

          def initialize(name, reflection:, **user_options)
            @reflection = reflection
            super(name, **user_options)
          end

          def render(view_context, record)
            view_context.attachment_preview record.send(name), **options
          end

          private

          def renderer_options
            {
              caption: true
            }
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
plutonium-0.12.9 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.12.8 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.12.7 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.12.5 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.12.4 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.12.3 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.12.2 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.12.1 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.12.0 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.11.2 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.11.1 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.11.0 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.8.0 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.6.2 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.6.1 lib/plutonium/core/fields/renderers/attachment_renderer.rb
plutonium-0.6.0 lib/plutonium/core/fields/renderers/attachment_renderer.rb