Class: Hyrax::Forms::BatchEditForm
- Defined in:
- app/forms/hyrax/forms/batch_edit_form.rb
Instance Attribute Summary collapse
-
#batch_document_ids ⇒ Object
readonly
Returns the value of attribute batch_document_ids.
-
#names ⇒ Object
Contains a list of titles of all the works in the batch.
Attributes inherited from WorkForm
#agreement_accepted, #current_ability
Class Method Summary collapse
-
.build_permitted_params ⇒ Object
Which parameters can we accept from the form.
Instance Method Summary collapse
-
#initialize(model, current_ability, batch_document_ids) ⇒ BatchEditForm
constructor
A new instance of BatchEditForm.
Methods inherited from WorkForm
#[], #collections_for_select, #display_additional_fields?, #member_of_collections, #primary_terms, sanitize_params, #secondary_terms, #select_files, #version, #work_members
Constructor Details
#initialize(model, current_ability, batch_document_ids) ⇒ BatchEditForm
Returns a new instance of BatchEditForm.
18 19 20 21 22 23 |
# File 'app/forms/hyrax/forms/batch_edit_form.rb', line 18 def initialize(model, current_ability, batch_document_ids) @names = [] @batch_document_ids = batch_document_ids @combined_attributes = initialize_combined_fields super(model, current_ability, nil) end |
Instance Attribute Details
#batch_document_ids ⇒ Object (readonly)
Returns the value of attribute batch_document_ids.
25 26 27 |
# File 'app/forms/hyrax/forms/batch_edit_form.rb', line 25 def batch_document_ids @batch_document_ids end |
#names ⇒ Object
Contains a list of titles of all the works in the batch
13 14 15 |
# File 'app/forms/hyrax/forms/batch_edit_form.rb', line 13 def names @names end |
Class Method Details
.build_permitted_params ⇒ Object
Which parameters can we accept from the form
28 29 30 31 32 33 34 35 |
# File 'app/forms/hyrax/forms/batch_edit_form.rb', line 28 def self.build_permitted_params (super + [:visibility_during_embargo, :embargo_release_date, :visibility_after_embargo, :visibility_during_lease, :lease_expiration_date, :visibility_after_lease, :visibility, based_near_attributes: [:id, :_destroy]]) - [{ work_members_attributes: [:id, :_destroy], based_near_attributes: [:id, :_destroy] }] end |