<%= form_for @vehicle do |f| %> <%= error_messages_for 'vehicle' %> <% if @existing_vehicle %>

<%= l(:text_vin_already_on_file) %> <%= link_to @existing_vehicle.to_s, vehicle_path(@existing_vehicle) %>

<% end %>
<%=t(:field_customer)%>:
<%= f.text_field :customer, class: "customer-name", autocomplete: "off", value: @vehicle.customer&.name, required: true,data: { autocomplete_url: "/customers/autocomplete" } %> <%= f.hidden_field :customer_id, id: "customer_id" %>
<%=t(:label_year)%>:
<%= f.number_field :year, autocomplete: "off" %>
<%=t(:label_make)%>:
<%= f.text_field :make, autocomplete: "off" %>
<%=t(:label_model)%>:
<%= f.text_field :model, autocomplete: "off" %>
<%=t(:field_vin)%>:
<%= f.text_field :vin , autofocus: true %>
<%=t(:field_notes)%>:

<%= f.text_area :notes, rows: 8, class: 'wiki-edit', style: 'width: 95%;', id: 'vehicle_notes' %> <%= wikitoolbar_for 'vehicle_notes' %>

<%= f.submit %>
<% end %>