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
-
#update!(params) ⇒ Object
Modify the incoming Rails params hash to be representable compliant.
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 36 |
# File 'lib/reform/form/active_model.rb', line 27 def update!(params) return super unless params.is_a?(Hash) # TODO: run this only for hash deserialization, but generically (#deserialize_hash ?). mapper.new(self).nested_forms do |attr, model| # FIXME: make this simpler. rename_nested_param_for!(params, attr) end super end |