Module: StimulusPlumbers::Form::Fields::Inputs::File

Included in:
Builder
Defined in:
lib/stimulus_plumbers/form/fields/inputs/file.rb

Instance Method Summary collapse

Instance Method Details

#file_field(attribute, options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/stimulus_plumbers/form/fields/inputs/file.rb', line 8

def file_field(attribute, options = {})
  Field.new(@template, **options).render(
    object,
    attribute,
    input_id: field_id(attribute)
  ) do |html_opts, opts, error|
    html_options = merge_html_options(opts, html_opts, field_theme(:form_file, error: error))
    super(attribute, html_options)
  end
end