From 87682c2cf4468593438c2dadd5ab949302f1a87d Mon Sep 17 00:00:00 2001 From: sk821 Date: Wed, 26 Sep 2018 16:18:05 +0800 Subject: [PATCH] fix employers account_settings form --- app/controllers/recruitments_controller.rb | 8 ++++++-- app/views/recruitments/account_settings.html.erb | 12 +++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/controllers/recruitments_controller.rb b/app/controllers/recruitments_controller.rb index 0a605cc..761aeaa 100644 --- a/app/controllers/recruitments_controller.rb +++ b/app/controllers/recruitments_controller.rb @@ -644,7 +644,9 @@ class RecruitmentsController < PseudoSessionController if params[:password].present? if pu.update_password(params[:password],params[:password_confirmation]) profile = @profile.profile - profile.active = params[:active].present? + if @profile.is_employee? + profile.active = params[:active].present? + end profile.save redirect_to mydashboard_path else @@ -652,7 +654,9 @@ class RecruitmentsController < PseudoSessionController end else profile = @profile.profile - profile.active = params[:active].present? + if @profile.is_employee? + profile.active = params[:active].present? + end profile.save redirect_to mydashboard_path end diff --git a/app/views/recruitments/account_settings.html.erb b/app/views/recruitments/account_settings.html.erb index fb70369..bfcd123 100644 --- a/app/views/recruitments/account_settings.html.erb +++ b/app/views/recruitments/account_settings.html.erb @@ -6,12 +6,14 @@
<%= t("recruitment.pass_confirm_pass_do_not_match") %>
<% end %>
+ <% if @profile.is_employee? %>
- -
- /> -
-
+ +
+ /> +
+ + <% end %>