Class: Fields::TextController
- Inherits:
-
ModelController
- Object
- ModelController
- Fields::TextController
- Defined in:
- app/fields/controllers/text_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#blurred ⇒ Object
When a field goes out of focus, then we want to start checking a field.
- #index ⇒ Object
Instance Method Details
#blurred ⇒ Object
When a field goes out of focus, then we want to start checking a field
23 24 25 |
# File 'app/fields/controllers/text_controller.rb', line 23 def @model.mark_field!(@field_name) end |
#index ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/fields/controllers/text_controller.rb', line 3 def index # Default to text fields @type ||= 'text' @label ||= nil # Get the reactive manager for the value passed in manager = @value.reactive_manager # Find the parent reactive value that produced the value # (usually just model._field) @model = manager.parents[0].reactive_value # Get the name of the field by looking at the method scope @field_name = manager.scope[0] # Find the errors for this field @errors = @model.marked_errors[@field_name] end |