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
34c4d0c6
Commit
34c4d0c6
authored
Aug 19, 2020
by
Tô Ngọc Ánh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix redirect link after signin, check is_applied_job in detail job
parent
a772e138
Pipeline
#967
canceled with stages
in 0 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
10 deletions
+19
-10
app/assets/stylesheets/common.scss
+1
-2
app/controllers/applied_jobs_controller.rb
+3
-3
app/controllers/jobs_controller.rb
+1
-0
app/controllers/users/sessions_controller.rb
+1
-1
app/views/jobs/show.html.erb
+4
-3
config/environment.rb
+5
-0
config/routes.rb
+4
-1
No files found.
app/assets/stylesheets/common.scss
View file @
34c4d0c6
...
...
@@ -40,4 +40,4 @@ background-color: $main-color;
display
:
none
;
}
}
}
\ No newline at end of file
}
app/controllers/applied_jobs_controller.rb
View file @
34c4d0c6
...
...
@@ -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
re
direct_to
new_applied_job_path
(
job_id:
@applied_job
.
job_id
)
flash
.
now
[
:error
]
=
@applied_job
.
errors
.
full_messages
re
nder
:new
end
end
...
...
@@ -24,7 +24,7 @@ class AppliedJobsController < ApplicationController
AppliedJobMailer
.
with
(
applied_job:
@applied_job
).
success_email
.
deliver_later
else
flash
[
:error
]
=
@applied_job
.
errors
.
full_messages
re
direct_to
new_applied_job_path
(
job_id:
@applied_job
.
job_id
)
re
nder
:new
end
end
...
...
app/controllers/jobs_controller.rb
View file @
34c4d0c6
...
...
@@ -9,5 +9,6 @@ class JobsController < ApplicationController
def
show
@job
=
Job
.
find_by
(
id:
params
[
:id
])
@is_not_applied
=
user_signed_in?
?
current_user
.
applied_jobs
.
find_by
(
job_id:
@job
.
id
).
blank?
:
true
end
end
app/controllers/users/sessions_controller.rb
View file @
34c4d0c6
...
...
@@ -26,6 +26,6 @@ class Users::SessionsController < Devise::SessionsController
# end
def
after_sign_in_path_for
(
resource
)
my_page_path
#your
path
stored_location_for
(
resource
)
||
my_page_
path
end
end
app/views/jobs/show.html.erb
View file @
34c4d0c6
...
...
@@ -31,15 +31,16 @@
<%=
@job
.
description
.
html_safe
%>
</div>
<div
class=
"col-2"
>
<%
is_not_applied
=
user_signed_in?
?
current_user
.
applied_jobs
.
find_by
(
job_id:
@job
.
id
).
blank?
:
true
%>
<%=
link_to_if
is_not_applied
,
'Apply Now'
,
new_applied_job_path
(
job_id:
@job
.
id
),
class:
'btn btn-outline-success btn-lg'
do
%>
<%=
link_to_if
@is_not_applied
,
'Apply Now'
,
new_applied_job_path
(
job_id:
@job
.
id
),
class:
'btn btn-outline-success btn-lg'
do
%>
<%=
link_to
'Apply Now'
,
'#'
,
class:
'btn btn-outline-secondary btn-lg disabled'
%>
<%
end
%>
</div>
</div>
<div
class=
"row my-3"
>
<div
class=
"col-6 text-right"
>
<%=
link_to
'Apply Now'
,
new_applied_job_path
(
job_id:
@job
.
id
),
class:
'btn btn-outline-success btn-lg'
%>
<%=
link_to_if
@is_not_applied
,
'Apply Now'
,
new_applied_job_path
(
job_id:
@job
.
id
),
class:
'btn btn-outline-success btn-lg'
do
%>
<%=
link_to
'Apply Now'
,
'#'
,
class:
'btn btn-outline-secondary btn-lg disabled'
%>
<%
end
%>
</div>
<div
class=
"col-6 text-left"
>
<%=
link_to
'Favorite'
,
'#'
,
class:
'btn btn-outline-danger btn-lg'
%>
...
...
config/environment.rb
View file @
34c4d0c6
# 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!
config/routes.rb
View file @
34c4d0c6
Rails
.
application
.
routes
.
draw
do
devise_for
:users
,
controllers:
{
sessions:
'users/sessions'
,
registrations:
'users/registrations'
}
root
to:
'home#index'
devise_for
:users
,
controllers:
{
sessions:
'users/sessions'
,
registrations:
'users/registrations'
}
get
'cities'
,
to:
'locations#index'
get
'industries'
,
to:
'industries#index'
get
'detail/:id'
,
to:
'jobs#show'
,
as: :job
get
'jobs/:model/:slug'
,
to:
'jobs#index'
,
as: :jobs
get
'my'
,
to:
'users#my_page'
,
as: :my_page
resources
:users
,
only: :show
get
'apply'
,
to:
'applied_jobs#new'
,
as: :new_applied_job
post
'confirm'
,
to:
'applied_jobs#confirm'
,
as: :confirm_applied_job
post
'finish'
,
to:
'applied_jobs#finish'
,
as: :finish_applied_job
...
...
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