Class: Sufia::Forms::CollectionEditForm
- Inherits:
-
Object
- Object
- Sufia::Forms::CollectionEditForm
- Includes:
- HydraEditor::Form
- Defined in:
- app/forms/sufia/forms/collection_edit_form.rb
Instance Method Summary collapse
-
#required?(key) ⇒ Boolean
Test to see if the given field is required.
Instance Method Details
#required?(key) ⇒ Boolean
Test to see if the given field is required
12 13 14 |
# File 'app/forms/sufia/forms/collection_edit_form.rb', line 12 def required?(key) model_class.validators_on(key).any? { |v| v.is_a? ActiveModel::Validations::PresenceValidator } end |