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
1
Merge Requests
1
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
Tô Ngọc Ánh
VeNJob
Commits
027bd940
Commit
027bd940
authored
Aug 20, 2020
by
Tô Ngọc Ánh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: display wrong fullname, email user at confirm page
parent
34c4d0c6
Pipeline
#968
failed with stages
in 0 seconds
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
9 deletions
+9
-9
app/controllers/applied_jobs_controller.rb
+3
-2
app/controllers/users_controller.rb
+1
-2
app/helpers/application_helper.rb
+1
-1
app/mailers/applied_job_mailer.rb
+1
-1
app/views/applied_jobs/confirm.html.erb
+2
-2
app/views/users/_user.html.erb
+1
-1
No files found.
app/controllers/applied_jobs_controller.rb
View file @
027bd940
...
...
@@ -4,6 +4,7 @@ class AppliedJobsController < ApplicationController
def
new
job
=
Job
.
find_by
(
id:
params
[
:job_id
])
return
redirect_to
root_path
if
job
.
nil?
@applied_job
=
job
.
applied_jobs
.
new
(
full_name:
current_user
.
full_name
,
email:
current_user
.
email
)
end
...
...
@@ -11,11 +12,11 @@ class AppliedJobsController < ApplicationController
def
confirm
@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?
return
if
@applied_job
.
valid?
flash
.
now
[
:error
]
=
@applied_job
.
errors
.
full_messages
render
:new
end
end
def
finish
@applied_job
=
current_user
.
applied_jobs
.
new
(
applied_job_params
)
...
...
app/controllers/users_controller.rb
View file @
027bd940
...
...
@@ -5,6 +5,5 @@ class UsersController < ApplicationController
@user
=
User
.
find_by
(
id:
params
[
:id
])
end
def
my_page
end
def
my_page
;
end
end
app/helpers/application_helper.rb
View file @
027bd940
module
ApplicationHelper
def
is_
current_user?
(
user
)
def
current_user?
(
user
)
current_user
==
user
end
end
app/mailers/applied_job_mailer.rb
View file @
027bd940
...
...
@@ -2,6 +2,6 @@ class AppliedJobMailer < ApplicationMailer
def
success_email
@applied_job
=
params
[
:applied_job
]
mail
(
to:
@applied_job
.
email
,
subject:
"Thank you for apply with VenJOB"
,
bcc:
ENV
[
'GMAIL_USERNAME'
])
mail
(
to:
@applied_job
.
email
,
subject:
'Thank you for apply with VenJOB'
,
bcc:
ENV
[
'GMAIL_USERNAME'
])
end
end
app/views/applied_jobs/confirm.html.erb
View file @
027bd940
...
...
@@ -20,7 +20,7 @@
<%=
f
.
label
:full_name
,
class:
'h5 font-weight-bold'
%>
</div>
<div
class=
"col-8"
>
<h5>
<%=
@applied_job
.
user
.
full_name
%>
</h5>
<h5>
<%=
@applied_job
.
full_name
%>
</h5>
<%=
f
.
hidden_field
:full_name
%>
</div>
</div>
...
...
@@ -29,7 +29,7 @@
<%=
f
.
label
:email
,
class:
'h5 font-weight-bold'
%>
</div>
<div
class=
"col-8"
>
<h5>
<%=
@applied_job
.
user
.
email
%>
</h5>
<h5>
<%=
@applied_job
.
email
%>
</h5>
<%=
f
.
hidden_field
:email
%>
</div>
</div>
...
...
app/views/users/_user.html.erb
View file @
027bd940
...
...
@@ -21,7 +21,7 @@
You don't have any curriculum vitae
<%
end
%>
</p>
<%
if
is_
current_user?
(
user
)
%>
<%
if
current_user?
(
user
)
%>
<div
class=
"row"
>
<div
class=
"col text-right"
>
<%=
link_to
'Update'
,
edit_user_registration_path
,
class:
'btn btn-outline-primary btn-lg'
%>
...
...
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