add conditions

parent 6dbda430
Pipeline #1047 failed with stages
in 0 seconds
...@@ -8,7 +8,7 @@ class AppliedJobsController < ApplicationController ...@@ -8,7 +8,7 @@ class AppliedJobsController < ApplicationController
apply_info[:name] ||= current_user.name apply_info[:name] ||= current_user.name
apply_info[:email] ||= current_user.email apply_info[:email] ||= current_user.email
session[:apply_job] = {:job_id => apply_info[:job_id]} session[:apply_job] = {job_id: apply_info[:job_id]}
@job_applied = current_user.job_applieds.new(name: apply_info[:name], @job_applied = current_user.job_applieds.new(name: apply_info[:name],
email: apply_info[:email]) email: apply_info[:email])
...@@ -23,8 +23,9 @@ class AppliedJobsController < ApplicationController ...@@ -23,8 +23,9 @@ class AppliedJobsController < ApplicationController
def confirmation def confirmation
@job_applied = current_user.job_applieds.new(apply_params) @job_applied = current_user.job_applieds.new(apply_params)
@job_applied.job_id = session[:apply_job]['job_id'] if @job_applied.job_id.blank? @job_applied.job_id = session[:apply_job]['job_id'] if @job_applied.job_id.blank?
@job_applied.cv_user = current_user.cv_user if @job_applied.cv_user.blank?
@job_applied.cv_user.retrieve_from_cache!(session[:cv]) if @job_applied.cv_user.blank? && session[:cv].present?
@job_applied.cv_user = current_user.cv_user if @job_applied.cv_user.blank?
if @job_applied.invalid? if @job_applied.invalid?
flash.now[:danger] = @job_applied.errors.full_messages.join('<br>') flash.now[:danger] = @job_applied.errors.full_messages.join('<br>')
render :new render :new
...@@ -44,7 +45,7 @@ class AppliedJobsController < ApplicationController ...@@ -44,7 +45,7 @@ class AppliedJobsController < ApplicationController
session.delete(:apply_job) session.delete(:apply_job)
else else
flash[:danger] = @job_applied.errors.full_messages.join('<br>') flash[:danger] = @job_applied.errors.full_messages.join('<br>')
redirect_to apply_job_path(job_id: session[:apply_job]['job_id']) redirect_to apply_job_path(job_id: @job.id)
end end
end end
......
...@@ -21,9 +21,6 @@ class UserCvUploader < CarrierWave::Uploader::Base ...@@ -21,9 +21,6 @@ class UserCvUploader < CarrierWave::Uploader::Base
%w(doc pdf xls xlsx zip) %w(doc pdf xls xlsx zip)
end end
def content_type_blacklist
%w(text/json application/json)
end
# Provide a default URL as a default if there hasn't been a file uploaded: # Provide a default URL as a default if there hasn't been a file uploaded:
# def default_url(*args) # def default_url(*args)
# # For Rails 3.1+ asset pipeline compatibility: # # For Rails 3.1+ asset pipeline compatibility:
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
</div> </div>
<div class="col-8-sm"> <div class="col-8-sm">
<%= link_to @job_applied.cv_user.identifier, @job_applied.cv_user.url, download: @job_applied.cv_user.identifier %> <%= link_to @job_applied.cv_user.identifier, @job_applied.cv_user.url, download: @job_applied.cv_user.identifier %>
<%= f.hidden_field :cv_user, value: @job_applied.cv_user.cache_name %>
</div> </div>
</div> </div>
......
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