Module: Reform::Form::ActiveModel

Defined in:
lib/reform/form/active_model.rb

Defined Under Namespace

Modules: ClassMethods, FormBuilderMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object


46
47
48
49
50
51
52
53
54
55
56
# File 'lib/reform/form/active_model.rb', line 46

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

    delegate [:persisted?, :to_key, :to_param, :id] => :model

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