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
Huỳnh Thiên Phước
venjob
Commits
b34ebf96
Commit
b34ebf96
authored
Aug 07, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change logic city
parent
dee59177
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
9 additions
and
10 deletions
+9
-10
app/controllers/cities_controller.rb
+2
-2
app/models/city.rb
+1
-2
app/views/cities/_international.html.erb
+0
-0
app/views/cities/_vietnam.html.erb
+0
-0
app/views/cities/index.html.erb
+2
-2
app/views/industries/_industry.html.erb
+0
-0
app/views/industries/index.html.erb
+1
-1
app/views/jobs/_job.html.erb
+0
-0
app/views/jobs/city_jobs.html.erb
+1
-1
app/views/jobs/index.html.erb
+1
-1
app/views/jobs/industry_jobs.html.erb
+1
-1
No files found.
app/controllers/cities_controller.rb
View file @
b34ebf96
class
CitiesController
<
ApplicationController
def
index
@cities_vietnam
=
City
.
vietnam
@cities_international
=
City
.
international
@cities_vietnam
=
City
.
location
(
1
)
@cities_international
=
City
.
location
(
0
)
end
end
app/models/city.rb
View file @
b34ebf96
...
...
@@ -4,8 +4,7 @@ class City < ApplicationRecord
has_many
:jobs
,
through: :city_jobs
scope
:top_city
,
->
{
joins
(
:jobs
).
group
(
:city_id
).
order
(
'count(job_id) DESC'
).
limit
(
9
)
}
scope
:vietnam
,
->
{
joins
(
:jobs
).
group
(
:city_id
).
order
(
'count(job_id) DESC'
).
where
(
'location = 1'
)
}
scope
:international
,
->
{
joins
(
:jobs
).
group
(
:city_id
).
order
(
'count(job_id) DESC'
).
where
(
'location = 0'
)
}
scope
:location
,
->
(
number
)
{
joins
(
:jobs
).
group
(
:city_id
).
order
(
'count(job_id) DESC'
).
where
(
location:
number
)
}
def
convert_city
converted_name
=
Convert
.
to_convert
(
"
#{
name
}
"
)
...
...
app/views/cities/_
city_
international.html.erb
→
app/views/cities/_international.html.erb
View file @
b34ebf96
File moved
app/views/cities/_
city_
vietnam.html.erb
→
app/views/cities/_vietnam.html.erb
View file @
b34ebf96
File moved
app/views/cities/index.html.erb
View file @
b34ebf96
...
...
@@ -14,13 +14,13 @@
<div
class=
"city-banner rounded vietnam-area"
>
Việt Nam
</div>
<div
class=
"city-vietnam"
>
<div
class=
"row"
>
<%=
render
partial:
"
city_
vietnam"
,
collection:
@cities_vietnam
,
as: :city
%>
<%=
render
partial:
"vietnam"
,
collection:
@cities_vietnam
,
as: :city
%>
</div>
</div>
<div
class=
"city-banner rounded international-area"
>
International
</div>
<div
class=
"city-international"
>
<div
class=
"row"
>
<%=
render
partial:
"
city_
international"
,
collection:
@cities_international
,
as: :city
%>
<%=
render
partial:
"international"
,
collection:
@cities_international
,
as: :city
%>
</div>
</div>
</div>
app/views/industries/_
all_
industry.html.erb
→
app/views/industries/_industry.html.erb
View file @
b34ebf96
File moved
app/views/industries/index.html.erb
View file @
b34ebf96
...
...
@@ -3,7 +3,7 @@
<div
class=
"all-industries"
>
<div
class=
"industry-banner rounded"
>
Industry List
</div>
<div
class=
"row"
>
<%=
render
partial:
"
all_
industry"
,
collection:
@industries
,
as: :industry
%>
<%=
render
partial:
"industry"
,
collection:
@industries
,
as: :industry
%>
</div>
</div>
</div>
app/views/jobs/_
all_jobs
.html.erb
→
app/views/jobs/_
job
.html.erb
View file @
b34ebf96
File moved
app/views/jobs/city_jobs.html.erb
View file @
b34ebf96
...
...
@@ -8,7 +8,7 @@
</div>
<%=
render
"jobs/pagination"
%>
<div
class=
"job-list"
>
<%=
render
partial:
"
all_jobs
"
,
collection:
@jobs_list
,
as: :job
%>
<%=
render
partial:
"
job
"
,
collection:
@jobs_list
,
as: :job
%>
</div>
<%=
render
"jobs/pagination"
%>
</div>
app/views/jobs/index.html.erb
View file @
b34ebf96
...
...
@@ -8,7 +8,7 @@
</div>
<%=
render
"jobs/pagination"
%>
<div
class=
"job-list"
>
<%=
render
partial:
"
all_jobs
"
,
collection:
@jobs_list
,
as: :job
%>
<%=
render
partial:
"
job
"
,
collection:
@jobs_list
,
as: :job
%>
</div>
<%=
render
"jobs/pagination"
%>
</div>
app/views/jobs/industry_jobs.html.erb
View file @
b34ebf96
...
...
@@ -8,7 +8,7 @@
</div>
<%=
render
"jobs/pagination"
%>
<div
class=
"job-list"
>
<%=
render
partial:
"
all_jobs
"
,
collection:
@jobs_list
,
as: :job
%>
<%=
render
partial:
"
job
"
,
collection:
@jobs_list
,
as: :job
%>
</div>
<%=
render
"jobs/pagination"
%>
</div>
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