Class: Fields::CheckboxController

Inherits:
MainController
  • Object
show all
Defined in:
app/fields/controllers/checkbox_controller.rb

Instance Method Summary collapse

Methods inherited from MainController

#blur, #errors, #field_name, #label, #marked

Instance Method Details

#inlineObject



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_instObject

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_fieldObject



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