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
9f44af60
Commit
9f44af60
authored
Feb 14, 2020
by
nnnghia98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit routes.rb
parent
8467f3e0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
8 deletions
+16
-8
app/controllers/jobs_controller.rb
+1
-1
app/controllers/users/my_pages_controller.rb
+2
-2
app/views/users/my_pages/show.html.erb
+1
-1
app/views/users/sessions/applied_jobs.html.erb
+3
-0
config/routes.rb
+9
-4
No files found.
app/controllers/jobs_controller.rb
View file @
9f44af60
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
def
index
...
...
app/controllers/users/my_pages_controller.rb
View file @
9f44af60
class
Users
::
MyPagesController
<
ApplicationController
before_action
:authenticate_user!
,
only:
[
:show
,
:applied_jobs
]
before_action
:authenticate_user!
,
only:
[
:show
]
def
show
end
def
applied_jobs
@applied_jobs
=
current_user
.
jobs
.
all
.
includes
(
:cities
).
decorate
@applied_jobs
=
current_user
.
jobs
.
includes
(
:cities
).
decorate
end
end
app/views/users/my_pages/show.html.erb
View file @
9f44af60
...
...
@@ -6,5 +6,5 @@
<h3>
My CV:
<%=
current_user
.
cv_path
%>
</h3>
<%=
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_users_my_page_path
,
class:
"btn btn-lg btn-primary"
%>
</div>
app/views/users/sessions/applied_jobs.html.erb
0 → 100644
View file @
9f44af60
<h1>
Applied jobs
</h1>
<%=
render
partial:
"jobs/job"
,
collection:
@applied_jobs
%>
config/routes.rb
View file @
9f44af60
...
...
@@ -2,9 +2,12 @@ Rails.application.routes.draw do
resources
:companies
,
only: :index
resources
:industries
,
only: :index
resources
:cities
,
only: :index
resources
:jobs
,
only:
[
:index
,
:show
]
get
"jobs/city/:city_id"
,
to:
"jobs#index"
,
as: :city_jobs
get
"jobs/industry/:industry_id"
,
to:
"jobs#index"
,
as: :industry_jobs
resources
:jobs
,
only:
[
:index
,
:show
]
do
collection
do
get
"city/:city_id"
,
action: :index
,
as: :city
get
"industry/:industry_id"
,
action: :index
,
as: :industry
end
end
get
"apply"
,
to:
"jobs#apply"
get
"confirm"
,
to:
"jobs#confirm_apply"
post
"done"
,
to:
'jobs#finish_apply'
...
...
@@ -12,7 +15,9 @@ Rails.application.routes.draw do
root
"tops#index"
namespace
:users
do
resource
:my_page
,
only: :show
do
get
"/jobs"
,
to:
"my_pages#applied_jobs"
collection
do
get
"jobs"
,
action: :applied_jobs
,
as: :applied_jobs
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