Sha256: 5ec5004ac1d1c78e76e2b4b4a3c9a53ba2d858b9a18c6db991fced22277346e1

Contents?: true

Size: 565 Bytes

Versions: 7

Compression:

Stored size: 565 Bytes

Contents

module ActionView
  module Helpers
    module Tags # :nodoc:
      class FileField < TextField # :nodoc:

        def render
          options = @options.stringify_keys

          if options.fetch("include_hidden", true)
            add_default_name_and_id(options)
            options[:type] = "file"
            tag("input", name: options["name"], type: "hidden", value: "") + tag("input", options)
          else
            options.delete("include_hidden")
            @options = options

            super
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
actionview-5.0.0.racecar1 lib/action_view/helpers/tags/file_field.rb
actionview-5.0.0.rc1 lib/action_view/helpers/tags/file_field.rb
actionview-5.0.0.beta4 lib/action_view/helpers/tags/file_field.rb
actionview-5.0.0.beta3 lib/action_view/helpers/tags/file_field.rb
actionview-5.0.0.beta2 lib/action_view/helpers/tags/file_field.rb
actionview-5.0.0.beta1.1 lib/action_view/helpers/tags/file_field.rb
actionview-5.0.0.beta1 lib/action_view/helpers/tags/file_field.rb