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



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

def input(wrapper_options=nil)
  merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
  template.(:div, class: 'input-group') do
    (template.(:span, class: 'input-group-btn') do
      template.(:span, class: 'btn btn-primary btn-file') do
        @builder.file_field(attribute_name, merged_input_options) + raw('Browse…')
      end
    end) +
    template.tag(:input, input_html_options.merge({class: 'form-control', type: 'text'}))
  end
end