Class: Hyrax::FormFactory
- Inherits:
-
Object
- Object
- Hyrax::FormFactory
- Defined in:
- app/services/hyrax/form_factory.rb
Overview
Note:
We use a factory class (rather than a factory method like ‘.for`) to provide compatibility with the legacy `Hyrax::WorkFormService`.
A factory class for Hyrax forms.
Instance Method Summary collapse
-
#build(model, _ability, _controller) ⇒ Object
Builds and prepopulates a form for the given model.
Instance Method Details
#build(model, _ability, _controller) ⇒ Object
Builds and prepopulates a form for the given model.
25 26 27 |
# File 'app/services/hyrax/form_factory.rb', line 25 def build(model, _ability, _controller) Hyrax::Forms::ResourceForm.for(resource: model).prepopulate! end |