Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@

# Ignore the environment variables
.env
.idea
12 changes: 11 additions & 1 deletion app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
class PagesController < ApplicationController
def welcome; end
def welcome
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Теперь нужно будет написать тест на этот метод

return unless user_signed_in?

redirect_to page_for_signed_in(current_user)
end

private

def page_for_signed_in(user)
{user.applicant? => vacancies_path, user.company? => resumes_path}[true]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нарушены стили robocop

end
end
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ def title(page_title)
end
end

def home_link
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужен будет тест на метод

root_path unless user_signed_in?
end

def flash_message_css_class(flash_type)
{ notice: "alert alert-info",
success: "alert alert-success",
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_header.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ nav.navbar.navbar-expand-lg.bg-body-tertiary
#navbarSupportedContent.collapse.navbar-collapse
ul.navbar-nav.me-auto.mb-2.mb-lg-0
li.nav-item
= link_to "Home", root_path, class: "nav-link fs-4 text-black"
= link_to "Home", home_link, class: "nav-link fs-4 text-black"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ты проверил локально, что будет если user не зашел в аккаунт и нажал на кнопку ?

li.nav-item
= link_to "Vacancies", vacancies_path, class: "nav-link fs-4 text-black"
- if user_signed_in?
Expand Down