Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Huỳnh Thiên Phước
venjob
Commits
d2fa7457
Commit
d2fa7457
authored
Aug 31, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add conditions
parent
6dbda430
Pipeline
#1047
failed with stages
in 0 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
7 deletions
+4
-7
app/controllers/applied_jobs_controller.rb
+4
-3
app/uploaders/user_cv_uploader.rb
+0
-3
app/views/applied_jobs/confirmation.html.erb
+0
-1
No files found.
app/controllers/applied_jobs_controller.rb
View file @
d2fa7457
...
@@ -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
...
...
app/uploaders/user_cv_uploader.rb
View file @
d2fa7457
...
@@ -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:
...
...
app/views/applied_jobs/confirmation.html.erb
View file @
d2fa7457
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment