fix page-ID2-ID3

parent cdbb0669
Pipeline #1374 failed with stages
in 0 seconds
class CityController < ApplicationController class CityController < ApplicationController
def list_city def list_city
@cities_vietnam = City.cities(City::REGION_VN_ID) @cities_vietnam = City.cities_by_region(City::REGION_VN_ID)
@cities_international = City.cities(City::REGION_INTERNATIONAL_ID) @cities_international = City.cities_by_region(City::REGION_INTERNATIONAL_ID)
end end
end end
\ No newline at end of file
...@@ -6,5 +6,5 @@ class City < ApplicationRecord ...@@ -6,5 +6,5 @@ class City < ApplicationRecord
REGION_VN_ID = 1 REGION_VN_ID = 1
REGION_INTERNATIONAL_ID = 2 REGION_INTERNATIONAL_ID = 2
scope :top_cities, -> { joins(:jobs).group(:name).order('count_all DESC').count.take(LATEST_CITY_NUMBER) } scope :top_cities, -> { joins(:jobs).group(:name).order('count_all DESC').count.take(LATEST_CITY_NUMBER) }
scope :cities, ->(value) { joins(:jobs).group(:name).having('count_all >= ?', 1).where("region_id = #{value}").order('count_all DESC').count } scope :cities_by_region, ->(value) { joins(:jobs).group(:name).having('count_all >= ?', 1).where('region_id = ?', value).order('count_all DESC').count }
end end
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.container .container
h3.p-3 h3.p-3
| Industries | Industries List
.row.my-3.text-center.fs-5 .row.my-3.text-center.fs-5
- @industry_list.each do |name, amount| - @industry_list.each do |name, amount|
.col-3.p-2.border.mb-1.fw-normal.bg-white .col-3.p-2.border.mb-1.fw-normal.bg-white
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment