Commit 13bd3aaa by thanhnd

fix review job detail 20200302 1

parent 4ac4147c
Pipeline #489 failed with stages
in 0 seconds
class JobsController < ApplicationController class JobsController < ApplicationController
def detail def show
job_id = params[:id] @job_detail = Job.find(params[:id])
@job_detail = Job.find(job_id)
end end
end end
...@@ -8,5 +8,4 @@ class Job < ApplicationRecord ...@@ -8,5 +8,4 @@ class Job < ApplicationRecord
belongs_to :company belongs_to :company
validates_presence_of :job_name validates_presence_of :job_name
scope :latest_job, ->{order(:last_updated).first(5)} scope :latest_job, ->{order(:last_updated).first(5)}
#scope :detail_job, ->{joins(:company, :city).select('jobs.id,job_name,city_name,company_name,salary,description')}
end end
Rails.application.routes.draw do Rails.application.routes.draw do
get '/detail/:id', to: 'jobs#detail' get '/detail/:id', to: 'jobs#show'
root 'top_page#index' root 'top_page#index'
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
resources :top_page resources :top_page
resources :jobs, :show
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