Commit 361e6dfa by Ngô Trung Hưng

fix toppage

parent eaf60d99
Pipeline #750 canceled with stages
in 0 seconds
......@@ -6,8 +6,8 @@ class HomeController < ApplicationController
@industries = Industry.order(name: :asc).all
@job_count = Job.all.count
@cities = City.all
@five_jobs = Job.order(created_at: :desc).limit(5)
@top_city = City.top_hot.take(9)
@top_industry = Industry.top_hot.take(9)
@lasted_jobs = Job.order(created_at: :desc).limit(Job::NUMBER_LASTED_JOB)
@top_cities = City.top_hot.take(9)
@top_industries = Industry.top_hot.take(9)
end
end
......@@ -2,6 +2,7 @@
# Description/Explanation of Person class
class Job < ApplicationRecord
NUMBER_LASTED_JOB = 5
belongs_to :company
has_many :industry_jobs
......
......@@ -3,7 +3,7 @@
<div class="container">
<div class="row">
<div class="col-sm-12">
<% @five_jobs.each do |val| %>
<% @lasted_jobs.each do |val| %>
<div class="box_jobs">
<div class="col-sm-12 d-block d-sm-none">
<% if cru == 1 %>
......
......@@ -4,7 +4,7 @@
<span>Top thành phố</span>
</div>
<div class="row no-gutters">
<% @top_city.each do |k,v| %>
<% @top_cities.each do |k,v| %>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<div class="box_info_city">
<div class="ct_name">
......
......@@ -4,7 +4,7 @@
<span>Top các nghành phổ biến</span>
</div>
<div class="row no-gutters">
<% @top_industry.each do |name, jobs_count| %>
<% @top_industries.each do |name, jobs_count| %>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<div class="box_info_city">
<div class="ct_name">
......
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