Class: Reform::Form::Populator::Sync

Inherits:
Reform::Form::Populator show all
Defined in:
lib/reform/form/populator.rb

Overview

Sync (default) blindly grabs the corresponding form twin and returns it. This might imply that nil is returned, and in turn #validate! is called on nil.

Instance Method Summary collapse

Methods inherited from Reform::Form::Populator

#call, #initialize

Constructor Details

This class inherits a constructor from Reform::Form::Populator

Instance Method Details

#call!(form, fragment, model, *args) ⇒ Object



72
73
74
75
76
77
78
79
80
81
# File 'lib/reform/form/populator.rb', line 72

def call!(form, fragment, model, *args)
  options = args.last

  if options.binding.array?
    index = args.first
    return model[index]
  else
    model
  end
end