rename some files

parent ee5eb9e1
Pipeline #842 failed with stages
in 0 seconds
......@@ -3,7 +3,7 @@
<div class="all-industries">
<div class="industry-banner rounded">Industry List</div>
<div class="row">
<%= render partial: "all_industries", collection: @industries, as: :industry %>
<%= render partial: "industry", collection: @industries, as: :industry %>
</div>
</div>
</div>
......@@ -8,6 +8,6 @@
<div class="col-4"><strong>Result for: ... jobs</strong></div>
</div>
<div class="job-list">
<%= render partial: "all_jobs", collection: @jobs_list, as: :job %>
<%= render partial: "job", collection: @jobs_list, as: :job %>
</div>
</div>
......@@ -10,12 +10,12 @@
<%= render 'layouts/search_bar' %>
</div>
<div class="job-list">
<%= render partial: "layouts/show_jobs", collection: @jobs, as: :job %>
<%= render partial: "layouts/show_job", collection: @jobs, as: :job %>
</div>
<div class="city-banner rounded">City</div>
<div class="row">
<%= render partial: "layouts/show_cities", collection: @jobs_of_cities, as: :city %>
<%= render partial: "layouts/show_city", collection: @jobs_of_cities, as: :city %>
</div>
<div class="all-city">
<%= link_to cities_path do %>
......@@ -26,7 +26,7 @@
</div>
<div class="industry-banner rounded">Industry</div>
<div class="row">
<%= render partial: "layouts/show_industries", collection: @jobs_of_industries, as: :industry %>
<%= render partial: "layouts/show_industry", collection: @jobs_of_industries, as: :industry %>
</div>
<div class="all-industry">
<%= link_to industries_path do %>
......
......@@ -43,16 +43,22 @@ class Crawler
def city_relationship(row, job)
location_relationship = row.css('div.map p a').children.map { |name_city| name_city.text.strip }
cities_relationship = City.where(name: location_relationship)
city_job_relationship = CityJob.where(job_id: job.id ,city_id: cities_relationship.ids)
if city_job_relationship.blank?
job.cities << cities_relationship
end
end
def industry_relationship(row, job)
industry_relationship = row.css('li a').children.map { |name_industry| name_industry.text.strip }
industries_relationship = Industry.where(name: industry_relationship)
industry_job_relationship = IndustryJob.where(job_id: job.id, industry_id: industries_relationship.ids)
if industry_job_relationship.blank?
job.industries << industries_relationship
end
end
def create_job(title, link_page, row, company)
description = link_page.search('div.detail-row').to_s
......
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