Module: Reform::Contract::Setup::Representer
- Defined in:
- lib/reform/contract/setup.rb
Overview
Mechanics for setting up initial Field values.
Instance Method Summary collapse
Methods included from Form::EmptyAttributesOptions
Methods included from Representer::WithOptions
Instance Method Details
#to_hash ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/reform/contract/setup.rb', line 29 def to_hash(*) nested_forms do |attr| attr.merge!( :representable => false, # don't call #to_hash. :prepare => lambda do |model, args| args.binding[:form].new(model) end ) end super # TODO: allow something like super(:exclude => empty_fields) end |