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
Mai Hoang Thai Ha
VenJob
Commits
98d6bf79
Commit
98d6bf79
authored
Jul 29, 2021
by
Mai Hoang Thai Ha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add link to job
parent
39711e75
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
app/controllers/top_controller.rb
+1
-1
app/models/job.rb
+2
-0
app/views/top/_latest_jobs.html.slim
+1
-1
No files found.
app/controllers/top_controller.rb
View file @
98d6bf79
class
TopController
<
ApplicationController
class
TopController
<
ApplicationController
def
index
def
index
@total_job
=
Job
.
count
@total_job
=
Job
.
count
@latest_jobs
=
Job
.
order
(
updated_at: :desc
).
limit
(
5
).
joins
(
:cities
).
includes
(
:company
,
:cities
,
:cities_jobs
)
@latest_jobs
=
Job
.
latest
@top_cities
=
City
.
top_jobs
@top_cities
=
City
.
top_jobs
@top_industries
=
Industry
.
top_jobs
@top_industries
=
Industry
.
top_jobs
end
end
...
...
app/models/job.rb
View file @
98d6bf79
class
Job
<
ApplicationRecord
class
Job
<
ApplicationRecord
scope
:latest
,
->
{
order
(
updated_at: :desc
).
limit
(
5
).
joins
(
:cities
).
includes
(
:company
,
:cities
,
:cities_jobs
)
}
has_and_belongs_to_many
:industries
has_and_belongs_to_many
:industries
has_and_belongs_to_many
:cities
has_and_belongs_to_many
:cities
belongs_to
:company
belongs_to
:company
...
...
app/views/top/_latest_jobs.html.slim
View file @
98d6bf79
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
hr
.my-2
hr
.my-2
-
@latest_jobs
.
each
do
|
job
|
-
@latest_jobs
.
each
do
|
job
|
.job-item.mb-4
.job-item.mb-4
=
link_to
job
.
title
,
"#"
,
class:
"job-title"
=
link_to
job
.
title
,
job_path
(
Job
.
find_by
(
title:
job
.
title
).
id
)
,
class:
"job-title"
.job-caption
.job-caption
=
link_to
job
.
company
.
name
,
"#"
,
class:
"job-company"
=
link_to
job
.
company
.
name
,
"#"
,
class:
"job-company"
p
.job-salary
p
.job-salary
...
...
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