Class: Reform::Form

Inherits:
Contract
  • Object
show all
Extended by:
Property
Includes:
Prepopulate, Validate
Defined in:
lib/reform/form/active_model/model_reflections.rb,
lib/reform/form.rb

Overview

ModelReflections will be the interface between the form object and form builders like simple_form.

This module is meant to collect all dependencies simple_form needs in addition to the ActiveModel ones. Goal is to collect all methods and define a reflection API so simple_form works with all ORMs and Reform doesn’t have to “guess” what simple_form and other form helpers need.

Defined Under Namespace

Modules: ActiveModel, ActiveRecord, Composition, Dry, Lotus, Module, Mongoid, MultiParameterAttributes, ORM, Prepopulate, Property, Validate Classes: Populator, UniqueValidator

Constant Summary collapse

Deserialize =

called after populator: form.deserialize(params) as this only included in the typed pipeline, it’s not applied for scalars.

->(input, options) { input.deserialize(options[:fragment]) }
Coercion =
Disposable::Twin::Coercion
ModelReflections =
ActiveModel::ModelReflections

Instance Attribute Summary

Attributes included from Contract::Validate

#errors

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Property

property

Methods included from Prepopulate

#prepopulate!

Methods included from Validate

#deserialize, #validate

Methods inherited from Contract

properties, property

Methods included from Contract::Readonly

#options_for, #readonly?

Methods included from Validation

included, #valid?

Methods included from Contract::Validate

#initialize, #validate, #validate!

Class Method Details

.default_nested_classObject



3
4
5
# File 'lib/reform/form.rb', line 3

def self.default_nested_class
  Form
end

Instance Method Details

#skip!Object



90
91
92
# File 'lib/reform/form.rb', line 90

def skip!
  Representable::Pipeline::Stop
end