Sha256: 383ccc1a4c8763a76630f10ccbc9e66d11b8a6ca7bb03d46d2d4f29e01099177
Contents?: true
Size: 770 Bytes
Versions: 22
Compression:
Stored size: 770 Bytes
Contents
# frozen_string_literal: true module Hyrax ## # A factory class for Hyrax forms. # # @note We use a factory class (rather than a factory method like `.for`) to # provide compatibility with the legacy `Hyrax::WorkFormService`. # # @example # factory = Hyrax::FormFactory.new # # form_change_set = factory.build(work) # # @since 3.0.0 class FormFactory ## # Builds and prepopulates a form for the given model. # # @param model [Object] # @param ability [Hyrax::Ability] # @param controller [ApplicationController] # # @see https://trailblazer.to/2.0/gems/reform/prepopulator.html def build(model, _ability, _controller) Hyrax::Forms::ResourceForm.for(model).prepopulate! end end end
Version data entries
22 entries across 22 versions & 1 rubygems