Module: Reform::Form::ActiveModel

Defined in:
lib/reform/form/active_model.rb,
lib/reform/form/active_model/validations.rb,
lib/reform/form/active_model/model_validations.rb,
lib/reform/form/active_model/form_builder_methods.rb

Defined Under Namespace

Modules: ClassMethods, FormBuilderMethods, ModelReflections, ModelValidations, Validations

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/reform/form/active_model.rb', line 6

def self.included(base)
  base.class_eval do
    extend ClassMethods
    register_feature ActiveModel

    extend Uber::Delegates
    delegates :model, *[:persisted?, :to_key, :to_param, :id] # Uber::Delegates

    def to_model # this is called somewhere in FormBuilder and ActionController.
      self
    end
  end
end

Instance Method Details

#model_name(*args) ⇒ Object



84
85
86
# File 'lib/reform/form/active_model.rb', line 84

def model_name(*args)
  self.class.model_name(*args)
end