Commit 87d06493 by Mai Hoang Thai Ha

fixed review

parent 5ac7cef2
......@@ -2,7 +2,7 @@ class AppliesController < ApplicationController
before_action :load_job, only: %i[new confirm create]
def new
@apply = if request.referer&.include?('confirm') && session[:apply_job].present?
@apply = if back?
ApplyJob.new(session[:apply_job])
else
current_user.apply_jobs.build
......@@ -50,4 +50,8 @@ class AppliesController < ApplicationController
def current_user
@current_user ||= User.first
end
def back?
request.referer&.include?('confirm') && session[:apply_job].present?
end
end
......@@ -3,7 +3,7 @@
= render 'ribbon'
.container
h1.my-5.text-center
| Apply form
| Apply Form
p.fs-5.fw-bold.mb-4.text-center
= @job.title
.col
......@@ -14,13 +14,13 @@
.col-2
= f.label :user_name, 'Full name', class: 'form-label label'
.col-10
= f.text_field :user_name, value: @apply.user_name ||= @current_user.name, class: 'form-control'
= f.text_field :user_name, value: @apply.user_name || @current_user.name, class: 'form-control'
span.form-msg
.row.mb-5.form-group
.col-2
= f.label :email, class: 'form-label label'
.col-10
= f.text_field :email, value: @apply.email ||= @current_user.email, class: 'form-control'
= f.text_field :email, value: @apply.email || @current_user.email, class: 'form-control'
span.form-msg
.row.mb-5.form-group
/ - if @user.cv.attached?
......@@ -31,7 +31,7 @@
= f.file_field :cv, accept: ApplyJob::ACCEPT_CONTENT_TYPE, class: 'form-control'
span.form-msg
br
= f.submit 'Confirm', class: 'btn btn-primary w-25 my-4 btn-height', data: { disable_with: false }
= f.submit 'Confirm', class: 'btn btn-primary w-25 my-4 btn-height',data: { disable_with: false }
= render 'validate_form'
javascript:
......
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