Added a line of code to candidates_controller in order for an admin to edit the candidate.

parent fc99cc9e
...@@ -20,6 +20,10 @@ class CandidatesController < ApplicationController ...@@ -20,6 +20,10 @@ class CandidatesController < ApplicationController
render "admin/candidates/new.html.erb" render "admin/candidates/new.html.erb"
end end
end end
def edit
@candidate = Candidate.find(params[:id])
render "admin/candidates/edit.html.erb"
end
def update def update
@candidate = Candidate.find(params[:id]) @candidate = Candidate.find(params[:id])
......
<h1>Admin New Candidate</h1> <h1>Admin Edit Candidate</h1>
<%= render partial: "form" %> <%= render partial: "form" %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment