Skip to content

Commit

Permalink
Add controller and route for resume preview
Browse files Browse the repository at this point in the history
  • Loading branch information
beherit197777 committed Nov 28, 2024
1 parent 592468d commit 4557690
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/controllers/web/account/resumes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ def update

def destroy; end

def preview
@resume = current_user.resumes.find(params[:id])
@resume_educations = @resume.educations.web
@resume_works = @resume.works.web
if @resume.draft?
render :preview
else
redirect_to account_resumes_path, alert: t('.not_accessible')
end
end

private

def change_state(resume)
Expand Down
6 changes: 5 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@
end

namespace :account do
resources :resumes
resources :vacancies
resources :notifications, only: %i[index update]
resource :newsletters, only: %i[edit update]
resource :profile, only: %i[edit update destroy]
resources :resumes do
member do
get :preview
end
end
scope module: :careers do
resources :members, only: %i[index]
end
Expand Down

0 comments on commit 4557690

Please sign in to comment.