Class: FileInput

Inherits:
SimpleForm::Inputs::FileInput
  • Object
show all
Defined in:
app/inputs/file_input.rb

Instance Method Summary collapse

Instance Method Details

#input(wrapper_options = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'app/inputs/file_input.rb', line 4

def input(wrapper_options = nil)
  merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)

  input_options = merged_input_options.extract!(:accept, :capture, :multiple)

  template.(:div, **stimulus_configuration) do
    template.concat(build_file_button_label(merged_input_options))
    template.concat(build_filename_display)
    template.concat(build_hidden_file_field(input_options))
  end
end