Commit 1f28d7e7 by Hoang Nam Nguyen

'Finished fix'

parent fbaa932a
/* header */
#logo {
width: 230px;
height: 120px;
width: 35%;
}
#distance {
......@@ -37,8 +36,7 @@ input[type=text]:focus {
#image_height {
padding-left: 5px;
width: 1835px;
height: 430px;
width: 99.5%;
}
#fontwords {
......
......@@ -5,16 +5,14 @@ class TopPagesController < ApplicationController
def industries
end
def toppage
@jobs = Job.limit(5)
def top_page
@jobs = Job.order(short_description: :desc, job_title: :desc,salary: :desc).limit(5)
@cities = City.limit(9)
@total_job = Job.count
@industries = Industry.limit(9)
end
def show
@job = Job.find(params[:id])
@city = City.find(params)
end
def index
......
class JobCity < ApplicationRecord
belongs_to :job
belongs_to :city
belongs_to :job, index: true
belongs_to :city, index: true
end
<nav class="navbar navbar-light bg-faded">
<div class="container-fluid">
<div class="navbar-header">
<img src="http://news.zigexn.co.jp/wp-content/uploads/img_pgpfb.png" class="navbar-brand" id="logo" href="zigexn.vn">
<img src="/assets/logo-de7018dbfd264fe7911d4f13f8ae89a4697a4624ae01a49de6e8df3f8e507041.png"" class="navbar-brand" id="logo" href="zigexn.vn">
</div>
<ul class="nav navbar-nav" id="slide">
<li><button type="button" class="btn btn-info" id="distance">Login</button></li>
......
......@@ -9,7 +9,7 @@
<body>
<%= render 'layouts/header' %>
<img src="https://images.careerbuilder.vn/background/chubb_1440x430_2017_08_25_orange_1503979439.jpg" id="image_height">
<img src="/assets/home_page-92e377f3edbb7945c7f7dc0ff74c6eec72b0d154f7fe3e301043af8c6fc58312.jpg" id="image_height">
<div class="container">
<%= yield %>
<%= render 'layouts/footer' %>
......
<% @cities.each do |city| %>
<div class="col-md-4 column_set">
<a href="#" class="titlejob">
<p>
<%= city.location %>
</p>
</a>
<li class="total_jobs">
<%= city.jobs.count %> Jobs
</li>
</div>
<div class="col-md-4 column_set">
<%= render partial: "city",locals: {city: city} unless city.jobs.count.zero? %>
</div>
<% end %>
<div>
<button type="button" class="btn btn-success" id="cities_button">All Cities</button>
<button type="button" class="btn btn-success" id="cities_button">All Cities</button>
</div>
\ No newline at end of file
<div class="jobs list-group-item">
<% @jobs.each do |job| %>
<a href="#">
<p>
<%= job.job_title %>
</p>
</a>
<li class="detail_description"> <%= truncate job.short_description,length: 160 %>
<%= link_to 'read more', '#' %> </li>
<li class="detail_description"> <%= job.salary %> </li>
<% job.cities.each do |city| %>
<li class="detail_description"> <%= city.location %> </li>
<% end %>
<%= render partial: "job",locals: {job: job} %>
<% end %>
</div>
\ No newline at end of file
<% @industries.each do |industry| %>
<div class="col-md-4 column_set">
<a href="#" class="titlejob">
<p>
<%= industry.industry_name %>
</p>
</a>
</div>
<% end %>
<div>
<button type="button" class="btn btn-success" id="cities_button">All Industry</button>
</div>
\ No newline at end of file
<div class="row">
<div class="col">
<h1 id="fontwords">Total jobs: <em> <%= @total_job %> </em>job</h1>
</div>
</div>
<div class="row">
<input type="text" name="search" placeholder="Search...." id="search_box">
<button type="button" class="btn btn-success" id="search_button">Search</button>
</div>
<p class="text-success line_job"> Latest Jobs</p>
<div class="row">
<%= render 'index' %>
</div>
<p class="text-success line_job">Top Cities</p>
<div class="row cities">
<%= render 'cities' %>
</div>
<p class="text-success line_job">Top Industry</p>
<div class="row cities">
<%= render 'industry' %>
</div>
Rails.application.routes.draw do
get 'top_pages/cities'
get 'top_pages/industries'
get 'top_pages/toppage'
get 'top_pages/top_page'
get 'top_pages/job'
root 'top_pages#toppage'# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
root 'top_pages#top_page'# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
class CreateJobCities < ActiveRecord::Migration[5.1]
def change
create_table :job_cities do |t|
t.belongs_to :city
t.belongs_to :job
t.belongs_to :city, index: true
t.belongs_to :job, index: true
t.timestamps
add_index
end
end
end
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