Module: ActiveForm::Form::ClassMethods

Defined in:
lib/activeform-rails/form.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#main_classObject

Returns the value of attribute main_class.



14
15
16
# File 'lib/activeform-rails/form.rb', line 14

def main_class
  @main_class
end

#main_modelObject

Returns the value of attribute main_model.



14
15
16
# File 'lib/activeform-rails/form.rb', line 14

def main_model
  @main_model
end

#reflected_classObject

Returns the value of attribute reflected_class.



14
15
16
# File 'lib/activeform-rails/form.rb', line 14

def reflected_class
  @reflected_class
end

Instance Method Details

#i18n_scopeObject



22
23
24
# File 'lib/activeform-rails/form.rb', line 22

def i18n_scope
  :activerecord
end

#modelsObject



26
27
28
# File 'lib/activeform-rails/form.rb', line 26

def models
  @models ||= []
end

#properties(*attributes, prefix: false, on:) ⇒ Object



16
17
18
19
20
# File 'lib/activeform-rails/form.rb', line 16

def properties(*attributes, prefix: false, on:)
  assign_delegators(attributes, on, prefix)
  add_model_on_list(on)
  add_accessor(on)
end