Guest User

Untitled

a guest
Jul 17th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. @job = Job.get(params[:id])
  2. redirect_if_not_found @job
  3.  
  4. @application = @job.applications.new(params[:application])
  5.  
  6. #If there's an error, render the form again
  7. haml(:'jobs/apply', :layout => false) unless @application.save
  8.  
  9. params[:answers].each do |id, answer|
  10. next unless question = Question.get(id)
  11. @application.answers.create(answer.merge(:question => question))
  12. end
Add Comment
Please, Sign In to add comment