New Candidate

<% if flash[:error].present? %>
<%= flash[:error] %>

<% @candidate.errors.messages.each do |k,v| %> <%= "#{k.to_s} #{v.join(' and ')}" %>
<% end %>

<% end %> <%= form_for @candidate, url: create_candidate_path do |form| %>
<%= form.label :name, "Candidate name" %> <%= form.text_field :name %>
<%= form.label :email, "Candidate email" %> <%= form.email_field :email %>
<%= form.label :experience, "Years of experience" %> <%= form.select :experience, experience_options(@candidate.experience), include_blank: false %>
<%= form.hidden_field :quiz_id, { value: Quiz.first.to_i } %> <%= submit_tag "Create" %> <% end %>