With Active record I can do the following to get form object.
class TestForm
extend ActiveModel::Naming
include ActiveModel::Conversion
include ActiveModel::Validations
def persisted?
false
end
end
class TestForm
include ActiveModel::Model
end
but how can I acheive the same with Mongoid 4?
Look at this https://github.com/apotonick/reform
Reform provides the following Mongoid specific features. They're mixed in automatically in a Rails/Mongoid setup.