Yes, it is possible to create a custom form in Active Admin without using an ActiveRecord database model. Active Admin is built on top of the Rails framework, and while it is primarily designed to work with ActiveRecord models, you can still create custom forms and interact with non-ActiveRecord models or even external APIs.
Here’s how you can achieve this:
- Define a Plain Ruby Class (Model):
Create a plain Ruby class that represents your custom model. This class does not need to inherit from
ActiveRecord::Base
. You can useActiveModel::Model
to include basic model behavior like validations and form handling.