Class: Fields::CheckboxController
- Inherits:
-
MainController
- Object
- Volt::ModelController
- MainController
- Fields::CheckboxController
- Defined in:
- app/fields/controllers/checkbox_controller.rb
Instance Method Summary collapse
- #inline ⇒ Object
-
#model_inst ⇒ Object
Find the parent reactive value that produced the value (usually just model._field).
- #setup_field ⇒ Object
Methods inherited from MainController
#blur, #errors, #field_name, #label, #marked
Instance Method Details
#inline ⇒ Object
12 13 14 15 |
# File 'app/fields/controllers/checkbox_controller.rb', line 12 def inline # Get the name of the field by looking at the method scope @field_name = attrs.checked_last_method.gsub(/^[_]/, '') end |
#model_inst ⇒ Object
Find the parent reactive value that produced the value (usually just model._field)
19 20 21 |
# File 'app/fields/controllers/checkbox_controller.rb', line 19 def model_inst attrs.checked_parent end |
#setup_field ⇒ Object
7 8 9 10 |
# File 'app/fields/controllers/checkbox_controller.rb', line 7 def setup_field # Get the name of the field by looking at the method scope @field_name = attrs.checked_last_method.gsub(/^[_]/, '') end |