Commit 5bc09eea by Ngô Trung Hưng

fix index top page

parent 67a53af5
Pipeline #760 failed with stages
in 0 seconds
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
class HomeController < ApplicationController class HomeController < ApplicationController
def index def index
@industries = Industry.order(name: :asc).all @industries = Industry.order(name: :asc).all
@job_count = Job.all.count @job_count = Job.count
@cities = City.all @cities = City.all_cities
@lasted_jobs = Job.order(created_at: :desc).limit(Job::NUMBER_LASTED_JOB) @lasted_jobs = Job.order(created_at: :desc).limit(Job::NUMBER_LASTED_JOB)
@top_cities = City.top_hot.take(9) @top_cities = City.top_hot.take(9)
@top_industries = Industry.top_hot.take(9) @top_industries = Industry.top_hot.take(9)
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
class City < ApplicationRecord class City < ApplicationRecord
has_many :city_jobs has_many :city_jobs
has_many :jobs, through: :city_jobs has_many :jobs, through: :city_jobs
scope :all_cities, -> { select :id, :name }
def self.top_hot def self.top_hot
hash = {} hash = {}
......
...@@ -9,7 +9,7 @@ threads threads_count, threads_count ...@@ -9,7 +9,7 @@ threads threads_count, threads_count
# Specifies the `port` that Puma will listen on to receive requests; default is 3000. # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
# #
port ENV.fetch("PORT") { 3000 } port ENV.fetch("PORT") { 1234 }
# Specifies the `environment` that Puma will run in. # Specifies the `environment` that Puma will run in.
# #
......
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