Commit 5c77f39a by Mai Hoang Thai Ha

fixed controller

parent 87d06493
......@@ -2,11 +2,8 @@ class AppliesController < ApplicationController
before_action :load_job, only: %i[new confirm create]
def new
@apply = if back?
ApplyJob.new(session[:apply_job])
else
current_user.apply_jobs.build
end
build_params = session[:apply_job] if use_apply_job_session?
@apply = current_user.apply_jobs.build(build_params)
end
def confirm
......@@ -51,7 +48,7 @@ class AppliesController < ApplicationController
@current_user ||= User.first
end
def back?
def use_apply_job_session?
request.referer&.include?('confirm') && session[:apply_job].present?
end
end
......@@ -15,5 +15,6 @@ p
| Full name: #{@apply.user_name}
p
| Email: #{@apply.email}
p CV:
p
| CV: #{url_for(@apply.cv)}
p Best,
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