Commit 11ec9546 by Hoang Phuc

Add params company and get jobs with company

parent 1245c7f2
Pipeline #549 failed with stages
in 0 seconds
......@@ -6,6 +6,9 @@ class JobController < ApplicationController
elsif params[:industry]
@jobs = Job.includes(:industries).where("industries.id = #{params[:industry]}").references(:industries).page(params[:page])
@amount_job = Job.includes(:industries).where("industries.id = #{params[:industry]}").references(:industries).count
elsif params[:company]
@jobs = Job.where("company_id = #{params[:company]}").page(params[:page])
@amount_job = Job.where("company_id = #{params[:company]}").count
else
@jobs = Job.order("id DESC").page(params[:page])
@amount_job = Job.count
......
......@@ -61,7 +61,7 @@
</a>
</h3>
<div class="job_listing-company">
<strong><%= job.company.title%></strong>
<strong><a href="/jobs?company=<%= job.company_id %>"><%= job.company.title%></a></strong>
</div>
</div>
<div class="job_listing-location job_listing__column">
......
......@@ -46,7 +46,7 @@
<a href="/job/<%= job.id %>"><%= job.title %></a>
</h3>
<div class="job_listing-company">
<strong><%= job.company.title %></strong>
<strong><a href="/jobs?company=<%= job.company_id %>"><%= job.company.title%></a></strong>
</div>
</div>
<div class="job_listing-location job_listing__column">
......
......@@ -14,7 +14,7 @@
</li>
<li class="date-posted"><%= @job.expiration_date %></li>
<li class="job-company">
<%= @job.company.title %>
<a href="/jobs?company=<%= @job.company_id %>"><%= @job.company.title %></a>
</li>
</ul>
</h3>
......
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