Sha256: b7f893eba2a8c71f6d13b62caf4ae487ff94f8a1c38b4cf8a431fdb83c7c36f6

Contents?: true

Size: 570 Bytes

Versions: 19

Compression:

Stored size: 570 Bytes

Contents

module Plutonium
  module Core
    module Fields
      module Inputs
        class AttachmentInput < SimpleFormInput
          attr_reader :reflection

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

          private

          def input_options
            options = {attachment: true} # enable the attachment component
            options[:input_html] = {multiple: true} if reflection.macro == :has_many_attached
            options
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
plutonium-0.15.18 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.17 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.16 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.15 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.14 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.13 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.12 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.11 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.10 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.9 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.8 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.7 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.6 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.5 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.4 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.3 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.2 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.1 lib/plutonium/core/fields/inputs/attachment_input.rb
plutonium-0.15.0 lib/plutonium/core/fields/inputs/attachment_input.rb