Commit c4c3b235 by Ngô Trung Hưng

..

parent 1342036a
Pipeline #808 canceled with stages
in 0 seconds
...@@ -19,8 +19,9 @@ class JobController < ApplicationController ...@@ -19,8 +19,9 @@ class JobController < ApplicationController
result(company) result(company)
end end
def find_jobs_by(model, parameter) def find_jobs
obj = model.find(parameter) d = params[:model].capitalize
obj = .find(params[:id])
result(obj) result(obj)
end end
......
...@@ -6,7 +6,6 @@ Rails.application.routes.draw do ...@@ -6,7 +6,6 @@ Rails.application.routes.draw do
get 'city/index' get 'city/index'
# Search # Search
get 'jobs/industry/:key_industry', to: 'job#find_jobs_by_industry' get 'jobs/:model/:id', to: 'job#find_jobs'
get 'jobs/company/:key_company', to: 'job#find_jobs_by_company'
get 'jobs/city/:key_city', to: 'job#find_jobs_by_city'
end end
...@@ -5,7 +5,7 @@ require 'open-uri' ...@@ -5,7 +5,7 @@ require 'open-uri'
# rake task # rake task
namespace :crawler do namespace :crawler do
task populate: :environment do task populate: :environment do
NUMBER_LINK_WILL_BE_CRAWLER = 1 NUMBER_LINK_WILL_BE_CRAWLER = 4
Company.find_or_create_by(name: 'Bảo mật') do |company| Company.find_or_create_by(name: 'Bảo mật') do |company|
company.address = 'Vui lòng xem trong mô tả công việc' company.address = 'Vui lòng xem trong mô tả công việc'
company.short_description = 'Vui lòng xem trong mô tả công việc' company.short_description = 'Vui lòng xem trong mô tả công việc'
......
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