candidate creation
This commit is contained in:
@ -7,9 +7,18 @@ class RecruiterController < ApplicationController
|
||||
|
||||
def new
|
||||
@candidate = Candidate.new
|
||||
render :form
|
||||
end
|
||||
|
||||
def create
|
||||
@candidate = Candidate.create(candidate_params.merge(recruiter_id: current_recruiter.id))
|
||||
|
||||
if @candidate.persisted?
|
||||
redirect_to recruiter_path, flash: { notice: "Sucessfully created candidate #{@candidate.name}" }
|
||||
else
|
||||
flash[:error] = "Failed to save Candidate."
|
||||
render :form
|
||||
end
|
||||
end
|
||||
|
||||
def login
|
||||
|
Reference in New Issue
Block a user