From 3bd9d3364c1550017463817db47bfc2719470ff4 Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Thu, 15 Sep 2016 15:09:47 -0500 Subject: [PATCH] removed hard coded emails for reviewer submission --- app/controllers/recruiter_controller.rb | 2 ++ app/views/recruiter/form.html.erb | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/recruiter_controller.rb b/app/controllers/recruiter_controller.rb index 4b6731e..8ca72cc 100644 --- a/app/controllers/recruiter_controller.rb +++ b/app/controllers/recruiter_controller.rb @@ -8,10 +8,12 @@ class RecruiterController < ApplicationController def new @candidate = Candidate.new + @quizzes = Quiz.order(:name) render :form end def create + @quizzes = Quiz.order(:name) @candidate = Candidate.create(candidate_params.merge(recruiter_id: current_recruiter.id)) if @candidate.persisted? diff --git a/app/views/recruiter/form.html.erb b/app/views/recruiter/form.html.erb index 1a71a96..386de96 100644 --- a/app/views/recruiter/form.html.erb +++ b/app/views/recruiter/form.html.erb @@ -18,7 +18,11 @@ <%= form.select :experience, experience_options(@candidate.experience), include_blank: false %> - <%= form.hidden_field :quiz_id, { value: Quiz.first.to_i } %> +
+ <%= form.label :quiz_id, "Quiz" %> + <%= form.select :quiz_id, options_from_collection_for_select(@quizzes, 'id', 'name'), include_blank: (@quizzes.size > 1) %> +
+ <%= submit_tag "Create" %> <% end %>