Class: Reform::Fields
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Reform::Fields
- Defined in:
- lib/reform/form.rb
Overview
Keeps values of the form fields. What’s in here is to be displayed in the browser! we need this intermediate object to display both “original values” and new input from the form after submitting.
Instance Method Summary collapse
-
#initialize(properties, values = {}) ⇒ Fields
constructor
A new instance of Fields.
Constructor Details
#initialize(properties, values = {}) ⇒ Fields
Returns a new instance of Fields.
289 290 291 292 |
# File 'lib/reform/form.rb', line 289 def initialize(properties, values={}) fields = properties.inject({}) { |hsh, attr| hsh.merge!(attr => nil) } super(fields.merge!(values)) # TODO: stringify value keys! end |