Sha256: 95a7589fe07cad214ad904071de1d4bf7520217afb13b1154c3d632e27236034

Contents?: true

Size: 376 Bytes

Versions: 7

Compression:

Stored size: 376 Bytes

Contents

# Simple custom select input control for SimpleForm that applies the select2
# javascript library for extra fanciness.
class Select2Input < SimpleForm::Inputs::CollectionSelectInput
  def input_options
    super.merge allow_blank: true
  end

  def input_html_options
    super.merge(
      style: 'width: 100%;',
      :'data-placeholder' => placeholder_text
    )
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stationed-0.6.0 lib/stationed/generators/templates/select2_input.rb
stationed-0.5.0 lib/stationed/generators/templates/select2_input.rb
stationed-0.4.0 lib/stationed/generators/templates/select2_input.rb
stationed-0.3.0 lib/stationed/generators/templates/select2_input.rb
stationed-0.2.0 lib/stationed/generators/templates/select2_input.rb
stationed-0.1.0 lib/stationed/generators/templates/select2_input.rb
stationed-0.0.1 lib/stationed/generators/templates/select2_input.rb