Commit 0aa1e580 by Mai Hoang Thai Ha

add job details

parent 88541d79
...@@ -6,12 +6,10 @@ class City < ApplicationRecord ...@@ -6,12 +6,10 @@ class City < ApplicationRecord
before_validation :add_slugs before_validation :add_slugs
def to_prarams def to_params
slug slug
end end
private
def add_slugs def add_slugs
update slug: to_slug(name) update slug: to_slug(name)
end end
......
...@@ -5,12 +5,10 @@ class Industry < ApplicationRecord ...@@ -5,12 +5,10 @@ class Industry < ApplicationRecord
before_validation :add_slugs before_validation :add_slugs
def to_prarams def to_params
slug slug
end end
private
def add_slugs def add_slugs
update slug: to_slug(name) update slug: to_slug(name)
end end
......
.breadcrumb
= link_to root_path, class: 'text-decoration-none text-info' do
'Home
span.d-block.mx-2
| >
- city_list = @job.cities
- city_list.each_with_index do |city, i|
= link_to city_jobs_path(city.slug), class: 'text-decoration-none text-info' do
= city.name
= " | " if i != city_list.length - 1
span.d-block.mx-2
| >
- industry_list = @job.industries
- industry_list.each_with_index do |industry, i|
= link_to industry_jobs_path(industry.slug), class: 'text-decoration-none text-info' do
= industry.name
= " | " if i != industry_list.length - 1
span.d-block.mx-2
| >
= @job.title
\ No newline at end of file
.job-detail.my5
.job-apply.d-flex.align-items-center.justify-content-between
h2.align-items-start
= @job.title
= link_to 'Apply for this job', '#', class: 'btn btn-primary'
p.text-secondary
= @job.company.name
ul.list-unstyled
- @job.cities.each do |city|
li
= city.name
p.text-success
= @job.salary
p
= @job.description
= info
.job-apply.d-flex.align-items-center.justify-content-between
= link_to 'Apply for this job', '#', class: 'btn btn-primary'
= link_to 'Favorite', '#', class: 'btn btn-primary'
.container .container
- @jobs.each do |job| - @jobs.each do |job|
.job-item .job-item
= link_to job.title, '#', class: 'job-title fs-3 text-decoration-none text-reset' = link_to job.title, job_path(Job.find_by(title: job.title).id), class: 'job-title fs-3 text-decoration-none text-reset'
.job-caption .job-caption
= link_to job.company.name, "#", class: "job-company text-decoration-none text-secondary" = link_to job.company.name, "#", class: "job-company text-decoration-none text-secondary"
p.job-salary.text-success p.job-salary.text-success
......
.search.text-center.my-5
.container
.row
.col-md-10.mb-md-0.no-padding
span.fa.fa-search.form-control-feedback
= search_field_tag :search, params[:search], placeholder: "Find a job", class: "form-control rounded-left no-border-radius bg-light h-100"
.col-md-2.mb-md-0.no-padding
= button_tag "", class: "h-100 w-100 btn btn-block btn-lg btn-info ", name: nil
| Search
\ No newline at end of file
- provide(:title, 'Job list page') - provide(:title, 'Job list page')
.search.text-center.my-5 = render 'search'
.container
.row
.col-md-10.mb-md-0.no-padding
span.fa.fa-search.form-control-feedback
= search_field_tag :search, params[:search], placeholder: "Find a job", class: "form-control rounded-left no-border-radius bg-light h-100"
.col-md-2.mb-md-0.no-padding
= button_tag "", class: "h-100 w-100 btn btn-block btn-lg btn-info fa fa-search rounded-right no-border-radius ", name: nil
| Search
.container .container
h1.mt-5 h1.mt-5
= @name = @name
......
.container.my-5 .container.my-5
.breadcrumb = render 'breadcrumb'
= link_to root_path, class: 'text-decoration-none text-info' do
'Home
span.d-block.ml-5
| >
- city_list = @job.cities
- city_list.each_with_index do |city, i|
= link_to city_jobs_path(city.slug), class: 'text-decoration-none text-info' do
= city.name
= " | " if i != city_list.length - 1
span.d-block
| >
- industry_list = @job.industries
- industry_list.each_with_index do |industry, i|
= link_to industry_jobs_path(industry.slug), class: 'text-decoration-none text-info' do
= industry.name
= " | " if i != industry_list.length - 1
span.d-block
| >
= @job.title
hr.my-4 hr.my-4
= render 'job_details'
\ No newline at end of file
...@@ -55,6 +55,7 @@ ActiveRecord::Schema.define(version: 2021_07_22_080023) do ...@@ -55,6 +55,7 @@ ActiveRecord::Schema.define(version: 2021_07_22_080023) do
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false
t.string "slug" t.string "slug"
t.index ["slug"], name: "index_cities_on_slug", unique: true
end end
create_table "cities_jobs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "cities_jobs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
...@@ -95,6 +96,7 @@ ActiveRecord::Schema.define(version: 2021_07_22_080023) do ...@@ -95,6 +96,7 @@ ActiveRecord::Schema.define(version: 2021_07_22_080023) do
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false
t.string "slug" t.string "slug"
t.index ["slug"], name: "index_industries_on_slug", unique: true
end end
create_table "industries_jobs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| create_table "industries_jobs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
......
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