Changes arguments of DmsfLinksHelper#files_for_select

The second argument 'folder_id' is set to nil by default. This could
be overridden if necessary.

Defining a default value for the helper method prevents the view
partial 'dmsf_links/_form.html.erb' to raise an ActionView::Template::Error
due to a missing argument.
This commit is contained in:
Liane Hampe 2023-08-15 14:55:27 +02:00
parent 38b6de3ba7
commit 3edf629389

View File

@ -35,7 +35,7 @@ module DmsfLinksHelper
str&.match?(/\A\d+\Z/)
end
def files_for_select(project_id, folder_id)
def files_for_select(project_id, folder_id = nil)
files = []
if DmsfLinksHelper.number?(folder_id)
folder = DmsfFolder.find_by(id: folder_id)