Class: Tungsten::FormForHelper::TungstenFormBuilder
- Inherits:
-
Object
- Object
- Tungsten::FormForHelper::TungstenFormBuilder
- Defined in:
- app/helpers/tungsten/form_for_helper.rb
Instance Method Summary collapse
-
#initialize(template, values, errors) ⇒ TungstenFormBuilder
constructor
A new instance of TungstenFormBuilder.
- #method_missing(method, field_name, options = {}, &block) ⇒ Object
Constructor Details
#initialize(template, values, errors) ⇒ TungstenFormBuilder
Returns a new instance of TungstenFormBuilder.
4 5 6 7 8 |
# File 'app/helpers/tungsten/form_for_helper.rb', line 4 def initialize(template, values, errors) @template = template @values = values @errors = errors end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, field_name, options = {}, &block) ⇒ Object
10 11 12 13 14 15 |
# File 'app/helpers/tungsten/form_for_helper.rb', line 10 def method_missing(method, field_name, = {}, &block) @template.send(method, field_name, .merge({ value: @values[field_name], errors: @errors[field_name] }.compact), &block) end |