add dropdowns for client, owner, builder in subproject form
This commit is contained in:
		| @@ -14,7 +14,14 @@ | ||||
|   <% subproject_form_fields.each do |attrib| %> | ||||
|   <div> | ||||
|     <%= form.label attrib, style: "display: block" %> | ||||
|     <%= form.text_field attrib, value: subproject.send(attrib) %> | ||||
|     <% case attrib %> | ||||
|       <% when :project %> | ||||
|         <%= form.collection_select :project_id, Project.all, :id, -> (project) { "#{project.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.capitalize}" %> | ||||
|     <% else %> | ||||
|       <%= form.text_field attrib, value: subproject.send(attrib) %> | ||||
|     <% end %> | ||||
|   </div> | ||||
|   <% end %> | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Stefan Tollkühn
					Stefan Tollkühn