Skip to content
Snippets Groups Projects
Commit 20fce172 authored by William Lee Hunter's avatar William Lee Hunter
Browse files

extra_form_fields

parent 230eae12
Branches extra_form_fields
1 merge request!26Remove extra empty form fields
# Attempting to override from Hydra Editor Gem 4.0.2:
# Multi Value Input - app/inputs/multi_value_input.rb
module MultiValueInputOverride
private
# only add a blank entry if the collection is empty
def collection
@collection ||= begin
val = object.send(attribute_name)
col = val.respond_to?(:to_ary) ? val.to_ary : val
col.reject { |value| value.to_s.strip.blank? }
col + [''] if col.empty?
col
end
end
end
......@@ -25,6 +25,7 @@ module Compel
Hyrax::HomepageController.prepend Hyrax::HomepageControllerOverride
Hyrax::Dashboard::ProfilesController.prepend Hyrax::Dashboard::ProfilesControllerOverride
Hyrax::PagesController.prepend Hyrax::PagesControllerOverride
MultiValueInput.prepend MultiValueInputOverride
end
end
end
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment