Class: Sufia::Forms::AdminSetForm
- Inherits:
-
CurationConcerns::Forms::CollectionEditForm
- Object
- CurationConcerns::Forms::CollectionEditForm
- Sufia::Forms::AdminSetForm
- Defined in:
- app/forms/sufia/forms/admin_set_form.rb
Class Method Summary collapse
-
.multiple?(_term) ⇒ Boolean
This determines whether the allowed parameters are single or multiple.
-
.sanitize_params(form_params) ⇒ Object
Overriden to cast ‘title’ and ‘description’ to an array.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Cast any array values on the model to scalars.
Class Method Details
.multiple?(_term) ⇒ Boolean
This determines whether the allowed parameters are single or multiple. By default it delegates to the model.
16 17 18 |
# File 'app/forms/sufia/forms/admin_set_form.rb', line 16 def multiple?(_term) false end |
.sanitize_params(form_params) ⇒ Object
Overriden to cast ‘title’ and ‘description’ to an array
21 22 23 24 25 26 |
# File 'app/forms/sufia/forms/admin_set_form.rb', line 21 def sanitize_params(form_params) super.tap do |params| params['title'] = Array.wrap(params['title']) if params.key?('title') params['description'] = Array.wrap(params['description']) if params.key?('description') end end |
Instance Method Details
#[](key) ⇒ Object
Cast any array values on the model to scalars.
8 9 10 11 |
# File 'app/forms/sufia/forms/admin_set_form.rb', line 8 def [](key) return super if key == :thumbnail_id super.first end |