Class: Fields::TextController
- Inherits:
-
ModelController
- Object
- ModelController
- Fields::TextController
- Defined in:
- app/fields/controllers/text_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#blur ⇒ Object
When a field goes out of focus, then we want to start checking a field.
- #index ⇒ Object
Instance Method Details
#blur ⇒ Object
When a field goes out of focus, then we want to start checking a field
24 25 26 27 28 |
# File 'app/fields/controllers/text_controller.rb', line 24 def blur @model.mark_field!(@field_name) self. = true end |
#index ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/fields/controllers/text_controller.rb', line 4 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 |