25
app/views/recruiter/_form.html.erb
Normal file
25
app/views/recruiter/_form.html.erb
Normal file
@ -0,0 +1,25 @@
|
||||
<%= render partial: 'shared/form_model_errors', locals: { obj: candidate } %>
|
||||
|
||||
<%= form_for candidate, url: create_candidate_path do |form| %>
|
||||
<div class="form-group">
|
||||
<%= form.label :name, "Candidate name" %>
|
||||
<%= form.text_field :name %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :email, "Candidate email" %>
|
||||
<%= form.email_field :email %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :experience, "Years of experience" %>
|
||||
<%= form.select :experience, experience_options(candidate.experience), include_blank: false %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :quiz_id, "Quiz" %>
|
||||
<%= form.select :quiz_id, quiz_options(quizzes, candidate.quiz_id), include_blank: (quizzes.size > 1) %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag %>
|
||||
<% end %>
|
6
app/views/recruiter/edit.html.erb
Normal file
6
app/views/recruiter/edit.html.erb
Normal file
@ -0,0 +1,6 @@
|
||||
<main class="intro_tpl">
|
||||
<h1>Edit: <%= @candidate.name %></h1>
|
||||
<p><strong>Test ID: </strong><%= @candidate.test_hash %></p>
|
||||
|
||||
<%= render partial: 'form', locals: { candidate: @candidate, quizzes: @quizzes } %>
|
||||
</main>
|
@ -1,28 +0,0 @@
|
||||
<main class="intro_tpl">
|
||||
<h1>New Candidate</h1>
|
||||
|
||||
<%= render partial: 'shared/form_model_errors', locals: { obj: @candidate } %>
|
||||
<%= form_for @candidate, url: create_candidate_path do |form| %>
|
||||
<div class="form-group">
|
||||
<%= form.label :name, "Candidate name" %>
|
||||
<%= form.text_field :name %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :email, "Candidate email" %>
|
||||
<%= form.email_field :email %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :experience, "Years of experience" %>
|
||||
<%= form.select :experience, experience_options(@candidate.experience), include_blank: false %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :quiz_id, "Quiz" %>
|
||||
<%= form.select :quiz_id, options_from_collection_for_select(@quizzes, 'id', 'name'), include_blank: (@quizzes.size > 1) %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag "Create" %>
|
||||
<% end %>
|
||||
</main>
|
@ -18,7 +18,7 @@
|
||||
|
||||
<% @candidates.each do |candidate| %>
|
||||
<tr>
|
||||
<td><%= candidate.name %></td>
|
||||
<td><%= link_to candidate.name, edit_candidate_path(candidate.id) %></td>
|
||||
<td><%= candidate.test_hash %></td>
|
||||
<td>
|
||||
<%= mail_to(candidate.email) %>
|
||||
|
5
app/views/recruiter/new.html.erb
Normal file
5
app/views/recruiter/new.html.erb
Normal file
@ -0,0 +1,5 @@
|
||||
<main class="intro_tpl">
|
||||
<h1>New Candidate</h1>
|
||||
|
||||
<%= render partial: 'form', locals: { candidate: @candidate, quizzes: @quizzes } %>
|
||||
</main>
|
Reference in New Issue
Block a user