bug fixing using cursor

This commit is contained in:
Stefan Tollkühn
2025-09-10 13:45:29 +02:00
parent 06bea4cf46
commit 59e63cee2f
6 changed files with 15 additions and 6 deletions

View File

@@ -10,9 +10,9 @@ module SubprojectsHelper
def subproject_form_input(form, attrib, subproject)
case attrib
when :project
form.collection_select :project_id, Project.all, :id, ->(project) { project.name }, prompt: "Select Project"
form.collection_select :project_id, Project.all, :id, :name, prompt: "Select Project"
when :client, :owner, :builder
form.collection_select "#{attrib}_id", Client.all, :id, ->(client) { "#{client.company_name} (#{client.lastname}, #{client.firstname})" }, prompt: "Select #{attrib.to_s.capitalize}"
form.collection_select "#{attrib}_id", Client.all, :id, :display_name, prompt: "Select #{attrib.to_s.capitalize}"
else
form.text_field attrib, value: subproject.send(attrib)
end