Module: Reform::Form::ActiveModel::FormBuilderMethods

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

Overview

TODO: rename to FormBuilderCompat.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
# File 'lib/reform/form/active_model.rb', line 3

def self.included(base)
  base.class_eval do
    extend ClassMethods # ::model_name
    features << FormBuilderMethods
  end
end

Instance Method Details

#update!(params) ⇒ Object

Modify the incoming Rails params hash to be representable compliant.



25
26
27
28
29
30
31
32
33
# File 'lib/reform/form/active_model.rb', line 25

def update!(params)
  # DISCUSS: #validate should actually expect the complete params hash and then pick the right key as it knows the form name.
  # however, this would cause confusion?
  mapper.new(self).nested_forms do |attr, model| # FIXME: make this simpler.
    rename_nested_param_for!(params, attr)
  end

  super
end