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
364b38c6
Commit
364b38c6
authored
Oct 10, 2017
by
Xuan Trung Le
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create the TOP, industry_list, city_list, job_detail pages.
parent
28eda34d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
app/models/industry.rb
+16
-0
app/views/industries/_industry.html.erb
+4
-0
app/views/layouts/application.html.erb
+24
-0
No files found.
app/models/industry.rb
View file @
364b38c6
class
Industry
<
ApplicationRecord
class
Industry
<
ApplicationRecord
<<<<<<<
28
eda34d875adbaa9af263755cbdb98465bc5939
has_many
:industries_jobs
has_many
:industries_jobs
has_many
:jobs
,
through: :industries_jobs
has_many
:jobs
,
through: :industries_jobs
...
@@ -10,4 +11,19 @@ class Industry < ApplicationRecord
...
@@ -10,4 +11,19 @@ class Industry < ApplicationRecord
order
(
jobs_count: :desc
)
}
order
(
jobs_count: :desc
)
}
scope
:availble_job
,
->
{
where
(
'jobs_count > 0'
)}
scope
:availble_job
,
->
{
where
(
'jobs_count > 0'
)}
=======
has_and_belongs_to_many
:jobs
scope
:top_industries
,
->
{
select
(
'industries.id, industries.name AS name, COUNT(jobs.id) AS jobs_count'
).
joins
(
:jobs
).
group
(
'industries.id'
).
order
(
'jobs_count DESC, name'
).
limit
(
9
)
}
scope
:industry_list
,
->
{
select
(
'industries.id, industries.name AS name, COUNT(jobs.id) AS jobs_count'
).
joins
(
:jobs
)
.
# where('jobs_count >= 1').
group
(
'industries.id'
).
order
(
'jobs_count DESC, name'
)
}
>>>>>>>
Create
the
TOP
,
industry_list
,
city_list
,
job_detail
pages
.
end
end
app/views/industries/_industry.html.erb
View file @
364b38c6
<div
class=
"col-md-
<%=
column
%>
maxH109"
>
<div
class=
"col-md-
<%=
column
%>
maxH109"
>
<div
class=
"job-intro well mr0 mrBot20 maxH89"
>
<div
class=
"job-intro well mr0 mrBot20 maxH89"
>
<
<<<<<<
28eda34d875adbaa9af263755cbdb98465bc5939
<
h4
class=
"mr0"
>
<%=
link_to
industry
.
name
,
industry_jobs_path
(
industry
)
%>
</h4>
<
h4
class=
"mr0"
>
<%=
link_to
industry
.
name
,
industry_jobs_path
(
industry
)
%>
</h4>
=======
<h4
class=
"mr0"
>
<%=
link_to
industry
.
name
,
"
#{
jobs_path
}
/industry/
#{
industry
.
id
}
"
%>
</h4>
>>>>>>> Create the TOP, industry_list, city_list, job_detail pages.
<p>
Jobs:
<span
class=
"badge"
>
<%=
industry
.
jobs_count
%>
</span></p>
<p>
Jobs:
<span
class=
"badge"
>
<%=
industry
.
jobs_count
%>
</span></p>
</div>
</div>
</div>
</div>
app/views/layouts/application.html.erb
View file @
364b38c6
...
@@ -3,11 +3,35 @@
...
@@ -3,11 +3,35 @@
<head>
<head>
<title>
Venjob
</title>
<title>
Venjob
</title>
<%=
csrf_meta_tags
%>
<%=
csrf_meta_tags
%>
<
<<<<<<
28eda34d875adbaa9af263755cbdb98465bc5939
<%=
stylesheet_link_tag
'application'
,
media:
'all'
,
'data-turbolinks-track'
:
'reload'
%>
<%=
stylesheet_link_tag
'application'
,
media:
'all'
,
'data-turbolinks-track'
:
'reload'
%>
<%=
javascript_include_tag
'application'
,
'data-turbolinks-track'
:
'reload'
%>
<%=
javascript_include_tag
'application'
,
'data-turbolinks-track'
:
'reload'
%>
</
head
>
</
head
>
=======
<link
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel=
"stylesheet"
integrity=
"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin=
"anonymous"
>
<link
href=
"https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
rel=
"stylesheet"
integrity=
"sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN"
crossorigin=
"anonymous"
>
<script
src=
"https://code.jquery.com/jquery-3.2.1.js"
integrity=
"sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE="
crossorigin=
"anonymous"
></script>
<script
src=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity=
"sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin=
"anonymous"
></script>
<%=
stylesheet_link_tag
'application'
,
media:
'all'
,
'data-turbolinks-track'
:
'reload'
%>
<%=
javascript_include_tag
'application'
,
'data-turbolinks-track'
:
'reload'
%>
</head>
>>>>>>> Create the TOP, industry_list, city_list, job_detail pages.
<body>
<body>
<%=
render
"layouts/menu"
%>
<%=
render
"layouts/menu"
%>
<%=
yield
%>
<%=
yield
%>
...
...
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