Module: Reform::Form::ActiveModel

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

Defined Under Namespace

Modules: ClassMethods, FormBuilderMethods, ModelReflections, ModelValidations

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/reform/form/active_model.rb', line 2

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

    delegate :persisted?, :to_key, :to_param, :id, to: :model

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

Instance Method Details

#model_name(*args) ⇒ Object



94
95
96
# File 'lib/reform/form/active_model.rb', line 94

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