Design page
-
app/assets/stylesheets/toppage.scss 0 → 100644
1 // Place all the styles related to the toppage controller here. -
Master
Remove this file.
-
-
-
app/controllers/toppage_controller.rb 0 → 100644
1 class ToppageController < ApplicationController -
Master
Đổi tên controller thành kiểu
TopPageController. Chú ý cách đặt tên của nhưng variable khác. -
-
-
app/controllers/toppage_controller.rb 0 → 100644
1 class ToppageController < ApplicationController 2 def index 3 @totaljob = Job.all.count -
Master
@totaljob = Job.all.count=>@total_job = Job.count -
-
-
app/controllers/toppage_controller.rb 0 → 100644
1 class ToppageController < ApplicationController 2 def index 3 @totaljob = Job.all.count -
Master
@totaljob = Job.all.count=>@total_job = Job.count -
-
-
app/controllers/toppage_controller.rb 0 → 100644
1 class ToppageController < ApplicationController 2 def index 3 @totaljob = Job.all.count 4 @latestjobs = Job.order(:last_updated).first(5) -
Master
Di chuyên logic trên vào trong scope. EX:
https://www.rubyguides.com/2019/10/scopes-in-ruby-on-rails/ -
-
-
app/controllers/toppage_controller.rb 0 → 100644
1 class ToppageController < ApplicationController 2 def index 3 @totaljob = Job.all.count 4 @latestjobs = Job.order(:last_updated).first(5) 5 @topindustry = Industry.joins(:jobs).select('industries.*, COUNT(jobs.id) as jobcount').group('jobs.industry_id').order(:jobcount).last(9) -
Master
@topindustry=>@top_industries -
Master
jobcount=>job_count -
-
-
app/controllers/toppage_controller.rb 0 → 100644
1 class ToppageController < ApplicationController 2 def index 3 @totaljob = Job.all.count 4 @latestjobs = Job.order(:last_updated).first(5) 5 @topindustry = Industry.joins(:jobs).select('industries.*, COUNT(jobs.id) as jobcount').group('jobs.industry_id').order(:jobcount).last(9) 6 @topcity = City.joins(:jobs).select('cities.*, COUNT(jobs.id) as jobcount').group('jobs.city_id').order(:jobcount).last(9) -
Master
Di chuyên logic trên vào trong scope. EX:
https://www.rubyguides.com/2019/10/scopes-in-ruby-on-rails/ -
-
-
app/helpers/toppage_helper.rb 0 → 100644
1 module ToppageHelper -
Master
Nếu không sử dụng thì xóa đi.
-
-
-
app/views/toppage/index.html.erb 0 → 100644
1 <div id="banner" class="container p-5 my-2 bg-secondary text-white"> 2 <div class="rowtp")> -
Master
<div class="rowtp")>=><div class="rowtp"> -
-
-
app/views/toppage/index.html.erb 0 → 100644
1 <div id="banner" class="container p-5 my-2 bg-secondary text-white"> 2 <div class="rowtp")> -
Master
<div class="rowtp")>=><div class="rowtp"> -
-
-
60 60 61 61 #insert data to Jobs table 62 62 Job.find_or_create_by(area_id: area.id, city_id: city.id , industry_id: industry.id, company_id: company.id, job_name: title.text, salary: salary.text, deadline: deadline.text, level: level.text, experience: experience.text.strip, last_updated: updated_date.text.strip, description: description.text) 63 64 #industryjob = IndustryJob.find_or_create_by(industry_id: industry.industry_id , job_id: job.job_id) -
test/controllers/toppage_controller_test.rb 0 → 100644
1 require 'test_helper' -
Master
Những file test không sử dụng thì xóa đi.
-
-
-
6 6 "@rails/activestorage": "^6.0.0", 7 7 "@rails/ujs": "^6.0.0", 8 8 "@rails/webpacker": "4.2.2", 9 "bootstrap": "^4.4.1", 10 "bootstrapp": "^0.0.0", -
Toggle commit list
-
59 59 company = Company.find_or_create_by(company_name: company_name.text, company_description: company_intro.text, address: address.text) 60 60 61 61 #insert data to Jobs table 62 Job.find_or_create_by(area_id: area.id, city_id: city.id , industry_id: industry.id, company_id: company.id, job_name: title.text, salary: salary.text, deadline: deadline.text, level: level.text, experience: experience.text.strip, last_updated: updated_date.text.strip, description: description.text) 62 job_table = Job.find_or_create_by(area_id: area.id, city_id: city.id , industry_id: industry.id, company_id: company.id, job_name: title.text, salary: salary.text, deadline: deadline.text, level: level.text, experience: experience.text.strip, last_updated: updated_date.text.strip, description: description.text) 63 64 #insert data to Industry_Jobs table 65 IndustryJob.find_or_create_by(industry_id: industry.id , job_id: job_table.id) -
Master
unless IndustryJob.exists?(industry_id: industry.id , job_id: job_table.id) IndustryJob.create(industry_id: industry.id , job_id: job_table.id) end -
-
-
59 59 company = Company.find_or_create_by(company_name: company_name.text, company_description: company_intro.text, address: address.text) -
Master
city = City.find_by(area_id: area.id, city_name: city_name) if city city.update_atributes :city_description, 'Tan Binh' else city = City.create(area_id: area.id, city_name: city_name, city_description: "") end
city = City.find_or_create_by(area_id: area.id, city_name: city_name) do |c| c.city_description = '' end
if City.exits?(area_id: area.id, city_name: city_name) city = City.create(area_id: area.id, city_name: city_name, city_description: "") end
-
-
-
Toggle commit list
-
canceled the automatic merge
Toggle commit list -
merged
Toggle commit list