fixed bug in candidate edit form

This commit is contained in:
Mark Moser 2016-09-16 13:40:23 -05:00
parent 5ac9b530fe
commit 37e628e27b
3 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<%= render partial: 'shared/form_model_errors', locals: { obj: candidate } %> <%= 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| %>
<div class="form-group"> <div class="form-group">
<%= form.label :name, "Candidate name" %> <%= form.label :name, "Candidate name" %>
<%= form.text_field :name %> <%= form.text_field :name %>

View File

@ -2,5 +2,5 @@
<h1>Edit: <%= @candidate.name %></h1> <h1>Edit: <%= @candidate.name %></h1>
<p><strong>Test ID: </strong><%= @candidate.test_hash %></p> <p><strong>Test ID: </strong><%= @candidate.test_hash %></p>
<%= render partial: 'form', locals: { candidate: @candidate, quizzes: @quizzes } %> <%= render partial: 'form', locals: { action: update_candidate_path(@candidate.id), candidate: @candidate, quizzes: @quizzes } %>
</main> </main>

View File

@ -1,5 +1,6 @@
<main class="intro_tpl"> <main class="intro_tpl">
<h1>New Candidate</h1> <h1>New Candidate</h1>
<%= render partial: 'form', locals: { candidate: @candidate, quizzes: @quizzes } %> <%= render partial: 'form', locals:
{ action: create_candidate_path, candidate: @candidate, quizzes: @quizzes } %>
</main> </main>