diff --git a/app/views/projects/_form.html.erb b/app/views/projects/_form.html.erb index 6055477..2c86f7b 100644 --- a/app/views/projects/_form.html.erb +++ b/app/views/projects/_form.html.erb @@ -25,20 +25,15 @@ <% [:client, :owner, :builder].each do |role| %>
<%= sp_form.label "#{role}_id", "Select Existing #{role.capitalize}" %> - <%= sp_form.collection_select "#{role}_id", Client.all, :id, :company_name, prompt: "Select #{role.capitalize}" %> + <%= sp_form.collection_select "#{role}_id", Client.all, :id, -> (client) { "#{client.company_name} (#{client.lastname}, #{client.firstname})" }, prompt: "Select #{role.capitalize}" %>
Or Create New <%= role.capitalize %> <%= sp_form.fields_for role do |c_form| %> - <%= c_form.label :company_name %> - <%= c_form.text_field :company_name %>
- <%= c_form.label :firstname %> - <%= c_form.text_field :firstname %>
- <%= c_form.label :lastname %> - <%= c_form.text_field :lastname %>
- <%= c_form.label :email %> - <%= c_form.text_field :email %>
- + <% [:company_name, :firstname, :lastname, :streetname, :zipcode, :city, :country, :email, :phone].each do |attrib|%> + <%= c_form.label attrib %> + <%= c_form.text_field attrib %>
+ <% end %> <% end %>