From 37e628e27b9aebde875d24308b1a64c31548fec4 Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Fri, 16 Sep 2016 13:40:23 -0500 Subject: [PATCH] fixed bug in candidate edit form --- app/views/recruiter/_form.html.erb | 2 +- app/views/recruiter/edit.html.erb | 2 +- app/views/recruiter/new.html.erb | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/recruiter/_form.html.erb b/app/views/recruiter/_form.html.erb index a70b8dd..0310471 100644 --- a/app/views/recruiter/_form.html.erb +++ b/app/views/recruiter/_form.html.erb @@ -1,6 +1,6 @@ <%= render partial: 'shared/form_model_errors', locals: { obj: candidate } %> -<%= form_for candidate, url: create_candidate_path do |form| %> +<%= form_for candidate, url: action, method: :post do |form| %>
<%= form.label :name, "Candidate name" %> <%= form.text_field :name %> diff --git a/app/views/recruiter/edit.html.erb b/app/views/recruiter/edit.html.erb index da33352..dc6aff7 100644 --- a/app/views/recruiter/edit.html.erb +++ b/app/views/recruiter/edit.html.erb @@ -2,5 +2,5 @@

Edit: <%= @candidate.name %>

Test ID: <%= @candidate.test_hash %>

- <%= render partial: 'form', locals: { candidate: @candidate, quizzes: @quizzes } %> + <%= render partial: 'form', locals: { action: update_candidate_path(@candidate.id), candidate: @candidate, quizzes: @quizzes } %> diff --git a/app/views/recruiter/new.html.erb b/app/views/recruiter/new.html.erb index 2c4059e..7892256 100644 --- a/app/views/recruiter/new.html.erb +++ b/app/views/recruiter/new.html.erb @@ -1,5 +1,6 @@

New Candidate

- <%= render partial: 'form', locals: { candidate: @candidate, quizzes: @quizzes } %> + <%= render partial: 'form', locals: + { action: create_candidate_path, candidate: @candidate, quizzes: @quizzes } %>