abstract class FormObject::Base(T)
- FormObject::Base(T)
- FormObject::AbstractForm
- Reference
- Object
Overview
Base class for Jennifer form object.
This class works only with Jennifer ORM.
class ContactForm < FormObject::Base(Contact)
attr :name, String
attr :sex, String, origin: :gender
attr :count, Int32, virtual: true
attr :_deleted, Bool?, virtual: true
end
FormObject::Base supports Jennifer validation DSL and API.
class ContactForm < FormObject::Base(Contact)
# ...
attr :count, Int32, virtual: true
validates_numericality :count, greater_than: 2
end
c = Contact.new
f = ContactForm.new(c)
f.verify(request)
f.valid?
f.errors # Jennifer::Model::Errors
Included Modules
- Jennifer::Model::Validation