Class: Kadmin::Select2
- Inherits:
-
Object
- Object
- Kadmin::Select2
- Includes:
- Presentable
- Defined in:
- app/components/kadmin/select2.rb,
app/components/kadmin/select2/form_tag.rb,
app/components/kadmin/select2/presenter.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#data_url ⇒ String
readonly
NOTE: using this assumes the backend URL uses a Finder object.
-
#display_property ⇒ String
readonly
The name of the display property for the model (if doing remote fetching).
-
#filter_param ⇒ String
readonly
The name of the filter param when doing remote fetching.
-
#placeholder ⇒ String
readonly
Will be used as a placeholder if given.
-
#value_property ⇒ String
readonly
The name of the property used as the selected value.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Select2
constructor
A new instance of Select2.
Methods included from Presentable
Constructor Details
#initialize(options = {}) ⇒ Select2
Returns a new instance of Select2.
23 24 25 26 |
# File 'app/components/kadmin/select2.rb', line 23 def initialize( = {}) @placeholder = [:placeholder].to_s.freeze ().freeze unless .blank? end |
Instance Attribute Details
#data_url ⇒ String (readonly)
NOTE: using this assumes the backend URL uses a Finder object
12 13 14 |
# File 'app/components/kadmin/select2.rb', line 12 def data_url @data_url end |
#display_property ⇒ String (readonly)
Returns the name of the display property for the model (if doing remote fetching).
18 19 20 |
# File 'app/components/kadmin/select2.rb', line 18 def display_property @display_property end |
#filter_param ⇒ String (readonly)
Returns the name of the filter param when doing remote fetching.
15 16 17 |
# File 'app/components/kadmin/select2.rb', line 15 def filter_param @filter_param end |
#placeholder ⇒ String (readonly)
Returns will be used as a placeholder if given.
7 8 9 |
# File 'app/components/kadmin/select2.rb', line 7 def placeholder @placeholder end |
#value_property ⇒ String (readonly)
Returns the name of the property used as the selected value.
21 22 23 |
# File 'app/components/kadmin/select2.rb', line 21 def value_property @value_property end |