Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
V
venjob
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 1
    • Issues 1
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 3
    • Merge Requests 3
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Xuan Trung Le
  • venjob
  • Merge Requests
  • !3

Merged
Opened Oct 10, 2017 by Xuan Trung Le@trunglx 
  • Report abuse
Report abuse

Features/create job pages

I have created the pages for displaying information concern job.(TOP, industry_list, city_list, job_list and job_detail.)

  • Discussion 7
  • Commits 6
  • Changes 57
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Oct 13, 2017
    Resolved by Xuan Trung Le Oct 16, 2017
    app/models/city.rb
    5
    6 scope :top_cities, -> { select('cities.id, cities.name AS name, COUNT(jobs.id) AS jobs_count').
    7 joins(:jobs).
    8 group('cities.id').
    9 order('jobs_count DESC, name').
    10 limit(9) }
    11
    12 scope :city_list, -> { select('cities.id, cities.name AS name, countries.name AS country_name,
    13 COUNT(jobs.id) AS jobs_count').
    14 joins(:jobs).
    15 joins(:country).
    16 # where('jobs_count >= 1').
    17 group('cities.id').
    18 order('jobs_count DESC, name') }
    19
    20 scope :get_job, -> id { find(id) }
    • Ba Toi Dang @toidb commented Oct 13, 2017
      Master

      Please check here again.

      Please check here again.
    • Xuan Trung Le @trunglx

      changed this line in version 3 of the diff

      Oct 16, 2017

      changed this line in version 3 of the diff

      changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3769&start_sha=912b5af97fe5d40f4daae9100dc032e5b714bf65#28495972e963898abf2919ffeaeb92fbdf49fb8e_20_17)
      Toggle commit list
    Please register or sign in to reply
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Oct 13, 2017
    Resolved by Xuan Trung Le Oct 16, 2017
    app/models/city.rb
    2 2 belongs_to :country, optional: true
    3 3 has_and_belongs_to_many :companies
    4 4 has_and_belongs_to_many :jobs
    5
    6 scope :top_cities, -> { select('cities.id, cities.name AS name, COUNT(jobs.id) AS jobs_count').
    • Ba Toi Dang @toidb commented Oct 13, 2017
      Master

      Use counter cache for optimizing counting job for the city.

      Please check others.

      Edited Oct 13, 2017 by Ba Toi Dang
      Use counter cache for optimizing counting job for the city. Please check others.
    • Xuan Trung Le @trunglx

      changed this line in version 3 of the diff

      Oct 16, 2017

      changed this line in version 3 of the diff

      changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3769&start_sha=912b5af97fe5d40f4daae9100dc032e5b714bf65#28495972e963898abf2919ffeaeb92fbdf49fb8e_6_7)
      Toggle commit list
    Please register or sign in to reply
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Oct 13, 2017
    Resolved by Xuan Trung Le Oct 16, 2017
    app/controllers/jobs_controller.rb 0 → 100644
    1 class JobsController < ApplicationController
    2 before_action :set_job, only: [:show]
    3 def index
    4 @jobs = Job.all.order(updated_date: 'DESC').limit(5)
    • Ba Toi Dang @toidb commented Oct 13, 2017
      Master

      Refactor code: Job.all.order(updated_date: 'DESC').limit(5) => Job.order(updated_date: :desc).limit(5)

      Refactor code: `Job.all.order(updated_date: 'DESC').limit(5)` => `Job.order(updated_date: :desc).limit(5)`
    • Xuan Trung Le @trunglx

      changed this line in version 3 of the diff

      Oct 16, 2017

      changed this line in version 3 of the diff

      changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3769&start_sha=912b5af97fe5d40f4daae9100dc032e5b714bf65#6fa69a07843a58f190bf4d7e0692b9cc5b0bf52b_4_4)
      Toggle commit list
    Please register or sign in to reply
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Oct 13, 2017
    Resolved by Xuan Trung Le Oct 16, 2017
    app/controllers/jobs_controller.rb 0 → 100644
    6 @industries = Industry.top_industries
    7 end
    8
    9 def show
    10 #code
    11 end
    12
    13 def job_lists
    14 #code
    15 end
    16
    17 def city
    18 city = City.find(params[:id])
    19 @jobs = city.jobs.page(params[:page]).per(20)
    20 @result = "jobs/City/#{city.name}"
    21 render :action => :job_lists
    • Ba Toi Dang @toidb commented Oct 13, 2017
      Master

      render :action => :job_lists => render action: :job_lists

      Please check others.

      Edited Oct 13, 2017 by Ba Toi Dang
      `render :action => :job_lists` => `render action: :job_lists` Please check others.
    • Xuan Trung Le @trunglx

      changed this line in version 5 of the diff

      Oct 16, 2017

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3771&start_sha=94090d827986b245c33e41446944f6e3722576fe#6fa69a07843a58f190bf4d7e0692b9cc5b0bf52b_16_16)
      Toggle commit list
    Please register or sign in to reply
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Oct 13, 2017
    Resolved by Xuan Trung Le Oct 16, 2017
    app/controllers/jobs_controller.rb 0 → 100644
    3 def index
    4 @jobs = Job.all.order(updated_date: 'DESC').limit(5)
    5 @cities = City.top_cities
    6 @industries = Industry.top_industries
    7 end
    8
    9 def show
    10 #code
    11 end
    12
    13 def job_lists
    14 #code
    15 end
    16
    17 def city
    18 city = City.find(params[:id])
    • Ba Toi Dang @toidb commented Oct 13, 2017
      Master

      Should use city_id instead of id.

      Please check others.

      Should use `city_id` instead of `id`. Please check others.
    • Xuan Trung Le @trunglx

      changed this line in version 3 of the diff

      Oct 16, 2017

      changed this line in version 3 of the diff

      changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3769&start_sha=912b5af97fe5d40f4daae9100dc032e5b714bf65#6fa69a07843a58f190bf4d7e0692b9cc5b0bf52b_18_13)
      Toggle commit list
    Please register or sign in to reply
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Oct 13, 2017
    Resolved by Xuan Trung Le Oct 16, 2017
    app/controllers/jobs_controller.rb 0 → 100644
    1 class JobsController < ApplicationController
    2 before_action :set_job, only: [:show]
    3 def index
    4 @jobs = Job.all.order(updated_date: 'DESC').limit(5)
    5 @cities = City.top_cities
    6 @industries = Industry.top_industries
    7 end
    8
    9 def show
    10 #code
    11 end
    12
    13 def job_lists
    • Ba Toi Dang @toidb commented Oct 13, 2017
      Master

      Should remove empty method.

      Should remove empty method.
    • Xuan Trung Le @trunglx

      changed this line in version 3 of the diff

      Oct 16, 2017

      changed this line in version 3 of the diff

      changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3769&start_sha=912b5af97fe5d40f4daae9100dc032e5b714bf65#6fa69a07843a58f190bf4d7e0692b9cc5b0bf52b_13_10)
      Toggle commit list
    Please register or sign in to reply
  • Ba Toi Dang
    @toidb started a discussion on an old version of the diff Oct 13, 2017
    Resolved by Xuan Trung Le Oct 16, 2017
    config/routes.rb
    1 1 Rails.application.routes.draw do
    2 2 devise_for :users
    3 get 'jobs/index'
    4 resources :cities, :industries, :jobs do
    5 get 'cities' => 'cities#index'
    6 get 'industries' => "industries#index"
    7 collection do
    8 get 'city/:id' => "jobs#city"
    • Ba Toi Dang @toidb commented Oct 13, 2017
      Master

      Refactor code: get 'city/:id' => "jobs#city" => get 'city/:city_id' => "jobs#city", as: :city_jobs

      And use city_jobs_path on view template.

      Please check others.

      Edited Oct 13, 2017 by Ba Toi Dang
      Refactor code: `get 'city/:id' => "jobs#city"` => `get 'city/:city_id' => "jobs#city", as: :city_jobs` And use `city_jobs_path` on view template. Please check others.
    • Xuan Trung Le @trunglx

      changed this line in version 3 of the diff

      Oct 16, 2017

      changed this line in version 3 of the diff

      changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3769&start_sha=912b5af97fe5d40f4daae9100dc032e5b714bf65#e801163eb9182955dca3eb9817d59af634f6665d_8_8)
      Toggle commit list
    Please register or sign in to reply
  • Xuan Trung Le @trunglx

    resolved all discussions

    Oct 16, 2017

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Xuan Trung Le @trunglx

    added 6 commits

    • 912b5af9...91b545e3 - 4 commits from branch master
    • 757cbfe4 - Create the TOP, industry_list, city_list, job_detail pages.
    • aec2ab4b - fix errors and optimize code.

    Compare with previous version

    Oct 16, 2017

    added 6 commits

    • 912b5af9...91b545e3 - 4 commits from branch master
    • 757cbfe4 - Create the TOP, industry_list, city_list, job_detail pages.
    • aec2ab4b - fix errors and optimize code.

    Compare with previous version

    added 6 commits * 912b5af9...91b545e3 - 4 commits from branch `master` * 757cbfe4 - Create the TOP, industry_list, city_list, job_detail pages. * aec2ab4b - fix errors and optimize code. [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3769&start_sha=912b5af97fe5d40f4daae9100dc032e5b714bf65)
    Toggle commit list
  • Xuan Trung Le @trunglx

    added 1 commit

    • 94090d82 - fix errors and optimize code.

    Compare with previous version

    Oct 16, 2017

    added 1 commit

    • 94090d82 - fix errors and optimize code.

    Compare with previous version

    added 1 commit * 94090d82 - fix errors and optimize code. [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3770&start_sha=aec2ab4be362c545631df6bd79c6485c33086ef7)
    Toggle commit list
  • Xuan Trung Le @trunglx

    added 1 commit

    • 1162f904 - fix errors

    Compare with previous version

    Oct 16, 2017

    added 1 commit

    • 1162f904 - fix errors

    Compare with previous version

    added 1 commit * 1162f904 - fix errors [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3771&start_sha=94090d827986b245c33e41446944f6e3722576fe)
    Toggle commit list
  • Xuan Trung Le @trunglx

    added 1 commit

    • ba5171d1 - fix errors

    Compare with previous version

    Oct 16, 2017

    added 1 commit

    • ba5171d1 - fix errors

    Compare with previous version

    added 1 commit * ba5171d1 - fix errors [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3772&start_sha=1162f904595761a737c5955bb76f126eab3e8ac1)
    Toggle commit list
  • Xuan Trung Le @trunglx

    added 1 commit

    • 16b405da - fix errors

    Compare with previous version

    Oct 16, 2017

    added 1 commit

    • 16b405da - fix errors

    Compare with previous version

    added 1 commit * 16b405da - fix errors [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3773&start_sha=ba5171d180bd4dc333e60ff2164404e127469449)
    Toggle commit list
  • Xuan Trung Le @trunglx

    added 1 commit

    • c86b29fd - Add bootrap and jquery

    Compare with previous version

    Oct 17, 2017

    added 1 commit

    • c86b29fd - Add bootrap and jquery

    Compare with previous version

    added 1 commit * c86b29fd - Add bootrap and jquery [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3777&start_sha=16b405daf212a95aac069a88e45173141fa72a75)
    Toggle commit list
  • Xuan Trung Le @trunglx

    added 1 commit

    • a9dbeb91 - install gem settinglogic and delete the unnecessary files

    Compare with previous version

    Oct 17, 2017

    added 1 commit

    • a9dbeb91 - install gem settinglogic and delete the unnecessary files

    Compare with previous version

    added 1 commit * a9dbeb91 - install gem settinglogic and delete the unnecessary files [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3782&start_sha=c86b29fde209f974e778a5c1e8300257c262c847)
    Toggle commit list
  • Xuan Trung Le @trunglx

    added 1 commit

    • 044c9439 - config kiminari view and settings.yml

    Compare with previous version

    Oct 17, 2017

    added 1 commit

    • 044c9439 - config kiminari view and settings.yml

    Compare with previous version

    added 1 commit * 044c9439 - config kiminari view and settings.yml [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/3/diffs?diff_id=3783&start_sha=a9dbeb910ac0910fa62a9963309ed7f42c84a86a)
    Toggle commit list
  • Ba Toi Dang @toidb

    mentioned in commit 28eda34d

    Oct 17, 2017

    mentioned in commit 28eda34d

    mentioned in commit 28eda34d875adbaa9af263755cbdb98465bc5939
    Toggle commit list
  • Ba Toi Dang @toidb

    merged

    Oct 17, 2017

    merged

    merged
    Toggle commit list
  • Write
  • Preview
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 sign in to comment
Xuan Trung Le
Assignee
Xuan Trung Le @trunglx
Assign to
None
Milestone
None
Assign milestone
Time tracking
2
2 participants
Reference: trunglx/venjob!3
×

Revert this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
×

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.