Class: ViewComponent::Form::FileFieldComponent

Inherits:
FieldComponent show all
Defined in:
app/components/view_component/form/file_field_component.rb

Instance Attribute Summary

Attributes inherited from FieldComponent

#method_name

Attributes inherited from BaseComponent

#form, #object_name, #options

Instance Method Summary collapse

Methods inherited from FieldComponent

#call, #initialize, #label_text, #method_errors, #method_errors?, #object_method_names, #optional?, #required?, #validators, #value

Methods inherited from BaseComponent

#html_class, #initialize, #object_errors, #object_errors?

Methods included from ClassNamesHelper

#build_tag_values, #class_names

Constructor Details

This class inherits a constructor from ViewComponent::Form::FieldComponent

Instance Method Details

#before_renderObject



8
9
10
11
12
13
14
15
# File 'app/components/view_component/form/file_field_component.rb', line 8

def before_render
  if Gem::Version.new(Rails::VERSION::STRING) >= Gem::Version.new("7.0")
    @options = { include_hidden: multiple_file_field_include_hidden }.merge!(options)
  end
  @options = convert_direct_upload_option_to_url(@options.dup)

  super
end