Class: Select2Input

Inherits:
SimpleForm::Inputs::CollectionSelectInput
  • Object
show all
Defined in:
lib/stationed/generators/templates/select2_input.rb

Overview

Simple custom select input control for SimpleForm that applies the select2 javascript library for extra fanciness.

Instance Method Summary collapse

Instance Method Details

#input_html_optionsObject



8
9
10
11
12
13
# File 'lib/stationed/generators/templates/select2_input.rb', line 8

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

#input_optionsObject



4
5
6
# File 'lib/stationed/generators/templates/select2_input.rb', line 4

def input_options
  super.merge allow_blank: true
end