Class: Input::Doubleselect::Cell

Inherits:
Cell
  • Object
show all
Defined in:
app/cells/lato_view/input/doubleselect/cell.rb

Constant Summary collapse

@@widths =
VIEW_INPUTWIDTH

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(first_select_name: 'input', second_select_name: '', first_select_label: '', width: 'large', required: false, disabled: false, custom_class: '', token: '', second_select_label: '', first_select_endpoint_url: '', second_select_endpoint_url: '', first_select_val: '', second_select_val: '', first_select_label_field: 'name', second_select_label_field: 'name', first_select_value_field: 'id', second_select_value_field: 'id') ⇒ Cell

Returns a new instance of Cell.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 12

def initialize(first_select_name: 'input',
			         second_select_name: '', first_select_label: '',
               width: 'large', required: false, disabled: false,
               custom_class: '', token:'', second_select_label: '',
               first_select_endpoint_url: '', second_select_endpoint_url: '',
               first_select_val: '', second_select_val: '',
               first_select_label_field: 'name', second_select_label_field: 'name',
               first_select_value_field: 'id', second_select_value_field: 'id'
               )
  # save params
  @width = width
  @required = required
  @disabled = disabled
  @custom_class = custom_class

  @first_select_label = first_select_label
  @second_select_label = second_select_label
  @first_select_endpoint_url = first_select_endpoint_url
  @second_select_endpoint_url = second_select_endpoint_url
  @first_select_name = first_select_name
  @second_select_name = second_select_name
  @first_select_val = first_select_val
  @second_select_val = second_select_val
  @first_select_label_field = first_select_label_field
  @second_select_label_field = second_select_label_field
  @first_select_value_field = first_select_value_field
  @second_select_value_field = second_select_value_field
  @token = token

  # advise to not use double select
  puts "@" * 20
  puts "DOUBLE SELECT IS DEPRECATED. USE NSELECT."
  puts "@" * 20

  # check params
  check_params
end

Instance Attribute Details

#custom_classObject

Returns the value of attribute custom_class.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def custom_class
  @custom_class
end

#disabledObject

Returns the value of attribute disabled.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def disabled
  @disabled
end

#first_select_endpoint_urlObject

Returns the value of attribute first_select_endpoint_url.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def first_select_endpoint_url
  @first_select_endpoint_url
end

#first_select_labelObject

Returns the value of attribute first_select_label.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def first_select_label
  @first_select_label
end

#first_select_label_fieldObject

Returns the value of attribute first_select_label_field.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def first_select_label_field
  @first_select_label_field
end

#first_select_nameObject

Returns the value of attribute first_select_name.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def first_select_name
  @first_select_name
end

#first_select_valObject

Returns the value of attribute first_select_val.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def first_select_val
  @first_select_val
end

#first_select_value_fieldObject

Returns the value of attribute first_select_value_field.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def first_select_value_field
  @first_select_value_field
end

#requiredObject

Returns the value of attribute required.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def required
  @required
end

#second_select_endpoint_urlObject

Returns the value of attribute second_select_endpoint_url.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def second_select_endpoint_url
  @second_select_endpoint_url
end

#second_select_labelObject

Returns the value of attribute second_select_label.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def second_select_label
  @second_select_label
end

#second_select_label_fieldObject

Returns the value of attribute second_select_label_field.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def second_select_label_field
  @second_select_label_field
end

#second_select_nameObject

Returns the value of attribute second_select_name.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def second_select_name
  @second_select_name
end

#second_select_valObject

Returns the value of attribute second_select_val.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def second_select_val
  @second_select_val
end

#second_select_value_fieldObject

Returns the value of attribute second_select_value_field.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def second_select_value_field
  @second_select_value_field
end

#tokenObject

Returns the value of attribute token.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def token
  @token
end

#widthObject

Returns the value of attribute width.



6
7
8
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 6

def width
  @width
end

Instance Method Details

#showObject



50
51
52
# File 'app/cells/lato_view/input/doubleselect/cell.rb', line 50

def show
  render "show.html"
end