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



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

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

Instance Method Details

#update!(params) ⇒ Object

Modify the incoming Rails params hash to be representable compliant.



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

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