Commit 3b5112ad by Tô Ngọc Ánh

keep value input if validation error

parent 936da9e5
Pipeline #964 canceled with stages
in 0 seconds
......@@ -40,4 +40,4 @@ background-color: $main-color;
display: none;
}
}
}
\ No newline at end of file
}
......@@ -12,8 +12,8 @@ class AppliedJobsController < ApplicationController
@applied_job = current_user.applied_jobs.new(applied_job_params)
@applied_job.curriculum_vitae = current_user.curriculum_vitae if params[:applied_job][:curriculum_vitae].nil?
if @applied_job.invalid?
flash[:error] = @applied_job.errors.full_messages
redirect_to new_applied_job_path(job_id: @applied_job.job_id)
flash.now[:error] = @applied_job.errors.full_messages
render :new
end
end
......
# Load the Rails application.
require_relative 'application'
# disable auto add field_with_errors class
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
html_tag.html_safe
end
# Initialize the Rails application.
Rails.application.initialize!
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