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
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xuan Trung Le
venjob
Commits
eb32d5c8
Commit
eb32d5c8
authored
Oct 27, 2017
by
Xuan Trung Le
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs
parent
de72620c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
10 additions
and
6 deletions
+10
-6
app/controllers/application_controller.rb
+0
-1
app/controllers/applies_controller.rb
+1
-0
app/controllers/cities_controller.rb
+0
-1
app/controllers/industries_controller.rb
+0
-1
app/controllers/jobs_controller.rb
+0
-1
app/controllers/my_pages_controller.rb
+2
-1
app/models/user.rb
+6
-0
app/views/my_pages/my_job.html.erb
+1
-1
No files found.
app/controllers/application_controller.rb
View file @
eb32d5c8
class
ApplicationController
<
ActionController
::
Base
protect_from_forgery
with: :exception
before_action
:authenticate_user!
helper_method
:clear_session_candidate
def
clear_session_candidate
...
...
app/controllers/applies_controller.rb
View file @
eb32d5c8
class
AppliesController
<
ApplicationController
before_action
:authenticate_user!
def
apply
session
[
:job_id
]
=
params
[
:job_id
]
if
params
[
:job_id
]
if
session
[
:candidate
].
present?
...
...
app/controllers/cities_controller.rb
View file @
eb32d5c8
class
CitiesController
<
ApplicationController
skip_before_action
:authenticate_user!
def
index
@cities
=
City
.
city_list
end
...
...
app/controllers/industries_controller.rb
View file @
eb32d5c8
class
IndustriesController
<
ApplicationController
skip_before_action
:authenticate_user!
def
index
@industries
=
Industry
.
industry_list
end
...
...
app/controllers/jobs_controller.rb
View file @
eb32d5c8
class
JobsController
<
ApplicationController
before_action
:set_job
,
only:
[
:show
]
skip_before_action
:authenticate_user!
,
only:
[
:index
,
:city
,
:industry
,
:company
,
:show
]
def
index
@jobs
=
Job
.
top_list
.
includes
(
:company
)
@cities
=
City
.
top_cities
.
includes
(
:country
)
...
...
app/controllers/my_pages_controller.rb
View file @
eb32d5c8
class
MyPagesController
<
ApplicationController
before_action
:authenticate_user!
def
index
@user
=
current_user
end
def
my_job
@jobs
=
current_user
.
applied_jobs
.
includes
(
:apply_jobs
).
includes
(
:company
)
@jobs
=
current_user
.
my_jobs
end
def
history
...
...
app/models/user.rb
View file @
eb32d5c8
...
...
@@ -47,6 +47,12 @@ class User < ApplicationRecord
applied_jobs
.
include?
(
job
)
end
def
my_jobs
Job
.
select
(
:'jobs.id'
,
:'jobs.name'
,
:'jobs.salary'
,
:'jobs.description'
,
:'apply_jobs.created_at'
,
:'companies.location'
).
joins
(
:company
,
:apply_jobs
).
where
(
apply_jobs:
{
user_id:
self
.
id
})
end
private
def
password_required?
...
...
app/views/my_pages/my_job.html.erb
View file @
eb32d5c8
...
...
@@ -8,7 +8,7 @@
<p><h4
class=
"mr0"
>
<%=
link_to
job
.
name
,
job_path
(
job
)
%>
</h4></p>
<p>
<%=
strip_tags
(
job
.
description
)[
0
...
250
]
%>
...
</p>
<p>
<span><strong>
Location:
</strong>
<%=
"
#{
job
.
company
.
location
}
"
%>
</span>
<span><strong>
Location:
</strong>
<%=
"
#{
job
.
location
}
"
%>
</span>
<span><strong>
Salary:
</strong>
<%=
job
.
salary
%>
</span>
<span
class=
"navbar-right"
><strong>
Applied at:
</strong>
<%=
job
.
applied_at
(
current_user
.
id
).
strftime
(
'%m/%d/%y'
)
%>
</span>
</p>
...
...
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