Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sort from vacansies #743

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/controllers/web/account/vacancies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ class Web::Account::VacanciesController < Web::Account::ApplicationController
after_action :verify_authorized, only: %i[edit update]

def index
@vacancies = current_user.vacancies.with_locale
query = { s: 'created_at desc' }.merge(params.permit![:q] || {})
@search = current_user.vacancies.with_locale.ransack(query)
@vacancies = @search.result
end

def new
Expand Down
8 changes: 6 additions & 2 deletions app/views/web/account/vacancies/index.html.slim
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
- content_for :header do
= t('.header')
.mb-3
= link_to t('.resume'), root_path

.mb-3.d-flex.justify-content-between
div
= link_to t('.resume'), root_path
div
= sort_link(@search, :created_at, class: 'dropdown-item py-2 py-sm-1')

- @vacancies.each do |vacancy|
.card.mb-3
Expand Down
Loading