Module: Hyrax::Forms

Defined in:
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/admin/appearance.rb,
app/forms/hyrax/forms/batch_upload_form.rb,
app/forms/hyrax/forms/file_manager_form.rb,
app/forms/hyrax/forms/file_set_edit_form.rb,
app/forms/hyrax/forms/workflow_action_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, BatchEditForm, BatchUploadForm, CollectionForm, FailedSubmissionFormWrapper, FileManagerForm, FileSetEditForm, FileSetForm, Permission, PermissionTemplateForm, ResourceForm, WorkForm, WorkflowActionForm, WorkflowResponsibilityForm

Class Method Summary collapse

Class Method Details

.ResourceForm(work_class) ⇒ Object

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

14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/forms/hyrax/forms/resource_form.rb', line 14

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

    include Hyrax::FormFields(:core_metadata)

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