Open
Description
Me and @m-Peter discussed some plans about the future of activeform.
Composite resources
Imagine the case when in user signup form user can enter company name and the company will be automatically created:
class UserWithCompanyForm > ActiveForm::Base
self.main_model = :user
attributes :email, :password, :company_name, presence: true
def save
if @model.save
Company.create(owner_id: @model.id, name: company_name)
true
else
false
end
end
end
Instead of code above, we could provide some API.
Support other ORMs than ActiveRecord
Probably Mongoid and/or MongoMapper.
Guide about Form Objects on guides.rubyonrails.org
Metadata
Metadata
Assignees
Labels
No labels