Module: BootstrapForm::CustomFileField
- Defined in:
 - lib/bootstrap_form/custom_file_field.rb
 
Instance Method Summary collapse
- 
  
    
      #custom_file_field(name, *args)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Give :choose_label as a option for changing the langfile default.
 
Instance Method Details
#custom_file_field(name, *args) ⇒ Object
Give :choose_label as a option for changing the langfile default.
      5 6 7 8 9 10 11 12 13 14 15 16  | 
    
      # File 'lib/bootstrap_form/custom_file_field.rb', line 5 def custom_file_field(name, *args) = args..symbolize_keys! args << form_group_builder(name, ) do content_tag('div', class: 'custom-file') do control = file_field_without_bootstrap(name, .merge(class: 'custom-file-input')) label = label(name, @template.t('bootstrap.file_input.placeholder', default: [[:choose_label], 'Choose file'].compact), class: "custom-file-label") concat(control).concat(label) end end end  |