Module: Hyrax::Forms

Defined in:
app/forms/hyrax/forms/lease.rb,
app/forms/hyrax/forms/embargo.rb,
app/forms/hyrax/forms/work_form.rb,
app/forms/hyrax/forms/permission.rb,
app/forms/hyrax/forms/file_set_form.rb,
app/forms/hyrax/forms/resource_form.rb,
app/forms/hyrax/forms/admin_set_form.rb,
app/forms/hyrax/forms/batch_edit_form.rb,
app/forms/hyrax/forms/collection_form.rb,
app/forms/hyrax/forms/work_lease_form.rb,
app/forms/hyrax/forms/admin/appearance.rb,
app/forms/hyrax/forms/pcdm_object_form.rb,
app/forms/hyrax/forms/batch_upload_form.rb,
app/forms/hyrax/forms/file_manager_form.rb,
app/forms/hyrax/forms/work_embargo_form.rb,
app/forms/hyrax/forms/file_set_edit_form.rb,
app/forms/hyrax/forms/pcdm_collection_form.rb,
app/forms/hyrax/forms/workflow_action_form.rb,
app/forms/hyrax/forms/administrative_set_form.rb,
app/forms/hyrax/forms/permission_template_form.rb,
app/forms/hyrax/forms/admin/collection_type_form.rb,
app/forms/hyrax/forms/widgets/admin_set_visibility.rb,
app/forms/hyrax/forms/workflow_responsibility_form.rb,
app/forms/hyrax/forms/dashboard/nest_collection_form.rb,
app/forms/hyrax/forms/failed_submission_form_wrapper.rb,
app/forms/hyrax/forms/widgets/admin_set_embargo_period.rb,
app/forms/hyrax/forms/admin/collection_type_participant_form.rb

Defined Under Namespace

Modules: Admin, Dashboard, Widgets Classes: AdminSetForm, AdministrativeSetForm, BatchEditForm, BatchUploadForm, CollectionForm, Embargo, FailedSubmissionFormWrapper, FileManagerForm, FileSetEditForm, FileSetForm, Lease, PcdmCollectionForm, PcdmObjectForm, Permission, PermissionTemplateForm, ResourceForm, WorkEmbargoForm, WorkForm, WorkLeaseForm, WorkflowActionForm, WorkflowResponsibilityForm

Class Method Summary collapse

Class Method Details

.ResourceForm(work_class) ⇒ Object

Note:

The returned class will extend Hyrax::Forms::PcdmObjectForm, not only Hyrax::Forms::ResourceForm. This is for backwards‚Äźcompatibility with existing Hyrax instances and satisfies the expected general use case (building forms for various PCDM object classes), but is not necessarily suitable for other kinds of Hyrax resource, like Hyrax::FileSets.

Examples:

defining a form class using HydraEditor-like configuration

class MonographForm < Hyrax::Forms::ResourceForm(Monograph)
  self.required_fields = [:title, :creator, :rights_statement]
  # other WorkForm-like configuration here
end


20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/forms/hyrax/forms/resource_form.rb', line 20

def self.ResourceForm(work_class)
  Class.new(Hyrax::Forms::PcdmObjectForm) do
    self.model_class = work_class

    ##
    # @return [String]
    def self.inspect
      return "Hyrax::Forms::ResourceForm(#{model_class})" if name.blank?
      super
    end
  end
end