Sha256: a967946921b4136c8b0a657e76cee9082dd317f4d917aa69a1332b2145928535

Contents?: true

Size: 674 Bytes

Versions: 89

Compression:

Stored size: 674 Bytes

Contents

module BootstrapForm
  module CustomFileField

    # Give :choose_label as a option for changing the langfile default.
    def custom_file_field(name, *args)
      options = args.extract_options!.symbolize_keys!
      args << options

      form_group_builder(name, options) do
        content_tag('div', class: 'custom-file') do
          control = file_field_without_bootstrap(name, options.merge(class: 'custom-file-input'))
          label = label(name, @template.t('bootstrap.file_input.placeholder', default: [options[:choose_label], 'Choose file'].compact), class: "custom-file-label")
          concat(control).concat(label)
        end
      end
    end

  end
end

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
egov_utils-1.5.0.alpha16 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha15 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha14 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha13 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha12 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha11 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha10 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha9 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha8 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha7 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha6 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha5 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha4 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.4.5 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.4.4 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha3 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha2 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.5.0.alpha1 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.4.3 lib/bootstrap_form/custom_file_field.rb
egov_utils-1.4.2 lib/bootstrap_form/custom_file_field.rb