Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compel
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
University Libraries Digital Library Development
compel
Commits
20fce172
Commit
20fce172
authored
6 years ago
by
William Lee Hunter
Browse files
Options
Downloads
Patches
Plain Diff
extra_form_fields
parent
230eae12
Branches
extra_form_fields
Branches containing commit
1 merge request
!26
Remove extra empty form fields
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/inputs/multi_value_input_override.rb
+18
-0
18 additions, 0 deletions
app/inputs/multi_value_input_override.rb
config/application.rb
+1
-0
1 addition, 0 deletions
config/application.rb
with
19 additions
and
0 deletions
app/inputs/multi_value_input_override.rb
0 → 100644
+
18
−
0
View file @
20fce172
# 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
This diff is collapsed.
Click to expand it.
config/application.rb
+
1
−
0
View file @
20fce172
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment