I have a form where I’m creating an interview for a job posting and one of the fields is a dropdown where I select the candidate (from a list of candidates created on another page) that I plan to interview.
So far I’m able to save the details of the interview as well as the candidates name, but I also want to save the candidates id. I’m not sure how to go about this.
Currently I have
= select("interview", "interviewee_name", Candidate.order('last_name ASC').collect {|c| [c.fullname]})
Somehow I need to find a way to retrieve and save the correct value to candidate_id.
Any help is appreciated 🙂
UPD
Then (if you really need to store its name) in model add callback: