Class: Trailblazer::Rails::Form
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Trailblazer::Rails::Form
- Defined in:
- lib/trailblazer/rails/form.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(delegated, model_class) ⇒ Form
constructor
A new instance of Form.
- #model_name ⇒ Object
- #to_model ⇒ Object
Constructor Details
#initialize(delegated, model_class) ⇒ Form
Returns a new instance of Form.
3 4 5 6 |
# File 'lib/trailblazer/rails/form.rb', line 3 def initialize(delegated, model_class) super(delegated) @model_class = model_class end |
Class Method Details
.name ⇒ Object
8 9 10 11 |
# File 'lib/trailblazer/rails/form.rb', line 8 def self.name # for whatever reason, validations climb up the inheritance tree and require _every_ class to have a name (4.1). "Reform::Form" end |
Instance Method Details
#model_name ⇒ Object
13 14 15 |
# File 'lib/trailblazer/rails/form.rb', line 13 def model_name ::ActiveModel::Name.new(self, nil, @model_class.to_s.camelize) end |
#to_model ⇒ Object
17 18 19 |
# File 'lib/trailblazer/rails/form.rb', line 17 def to_model self end |