Method: Reform::Form::Sync#sync!

Defined in:
lib/reform/form/sync.rb

#sync!(options) ⇒ Object

reading from fields allows using readers in form for presentation and writers still pass to fields in #validate????



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/reform/form/sync.rb', line 12

def sync!(options) # semi-public.
  options = Reform::Representer::Options[options.merge(:form => self)] # options local for this form, only.

  input = sync_hash(options)
  # if aliased_model was a proper Twin, we could do changed? stuff there.

  options.delete(:exclude) # TODO: can we use 2 options?

  dynamic_sync_representer.new(aliased_model).from_hash(input, options) # sync properties to Song.

  model
end