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
Nguyen Ngoc Nghia
VeNJOB
Commits
b2de9402
Commit
b2de9402
authored
Feb 14, 2020
by
nnnghia98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change applied jobs path
parent
8467f3e0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
8 deletions
+9
-8
app/controllers/jobs_controller.rb
+5
-1
app/controllers/users/my_pages_controller.rb
+1
-5
app/views/jobs/applied_jobs.html.erb
+0
-0
app/views/users/my_pages/show.html.erb
+1
-1
config/routes.rb
+2
-1
No files found.
app/controllers/jobs_controller.rb
View file @
b2de9402
class
JobsController
<
ApplicationController
class
JobsController
<
ApplicationController
before_action
:authenticate_user!
,
only:
[
:apply
,
:confirm_apply
,
:finish_apply
]
before_action
:authenticate_user!
,
only:
[
:apply
,
:confirm_apply
,
:finish_apply
,
:applied_jobs
]
before_action
:find_user
,
only: :apply_available
before_action
:find_user
,
only: :apply_available
def
index
def
index
...
@@ -46,6 +46,10 @@ class JobsController < ApplicationController
...
@@ -46,6 +46,10 @@ class JobsController < ApplicationController
user_jobs
.
find_by
(
job_id:
@job_id
,
user_id:
@user
.
id
)
user_jobs
.
find_by
(
job_id:
@job_id
,
user_id:
@user
.
id
)
end
end
def
applied_jobs
@applied_jobs
=
current_user
.
jobs
.
includes
(
:cities
).
decorate
end
private
private
def
confirm_apply_info_params
def
confirm_apply_info_params
...
...
app/controllers/users/my_pages_controller.rb
View file @
b2de9402
class
Users
::
MyPagesController
<
ApplicationController
class
Users
::
MyPagesController
<
ApplicationController
before_action
:authenticate_user!
,
only:
[
:show
,
:applied_jobs
]
before_action
:authenticate_user!
,
only:
[
:show
]
def
show
def
show
end
end
def
applied_jobs
@applied_jobs
=
current_user
.
jobs
.
all
.
includes
(
:cities
).
decorate
end
end
end
app/views/
users/my_page
s/applied_jobs.html.erb
→
app/views/
job
s/applied_jobs.html.erb
View file @
b2de9402
File moved
app/views/users/my_pages/show.html.erb
View file @
b2de9402
...
@@ -6,5 +6,5 @@
...
@@ -6,5 +6,5 @@
<h3>
My CV:
<%=
current_user
.
cv_path
%>
</h3>
<h3>
My CV:
<%=
current_user
.
cv_path
%>
</h3>
<%=
link_to
"Edit"
,
edit_user_registration_path
,
class:
"btn btn-lg btn-primary"
%>
<%=
link_to
"Edit"
,
edit_user_registration_path
,
class:
"btn btn-lg btn-primary"
%>
<%=
link_to
"My jobs"
,
jobs_users_my_page
_path
,
class:
"btn btn-lg btn-primary"
%>
<%=
link_to
"My jobs"
,
applied_jobs
_path
,
class:
"btn btn-lg btn-primary"
%>
</div>
</div>
config/routes.rb
View file @
b2de9402
...
@@ -10,9 +10,10 @@ Rails.application.routes.draw do
...
@@ -10,9 +10,10 @@ Rails.application.routes.draw do
post
"done"
,
to:
'jobs#finish_apply'
post
"done"
,
to:
'jobs#finish_apply'
devise_for
:users
devise_for
:users
root
"tops#index"
root
"tops#index"
get
"users/my_page/jobs"
,
to:
"jobs#applied_jobs"
,
as: :applied_jobs
namespace
:users
do
namespace
:users
do
resource
:my_page
,
only: :show
do
resource
:my_page
,
only: :show
do
get
"/jobs"
,
to:
"my_pages#applied_jobs"
# get "/jobs", to: "my_pages#applied_jobs", as: :applied_jobs
end
end
end
end
end
end
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