fix employers account_settings form

This commit is contained in:
sk821 2018-09-26 16:18:05 +08:00
parent 069adb6c7b
commit 87682c2cf4
2 changed files with 13 additions and 7 deletions

View File

@ -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

View File

@ -6,12 +6,14 @@
<div class="alert alert-danger"><%= t("recruitment.pass_confirm_pass_do_not_match") %></div>
<% end %>
<form class="form-horizontal" action="/recruit/update_settings" method="post">
<% if @profile.is_employee? %>
<div class="form-group">
<label class="col-sm-2 control-label"><%= t("recruitment.search_active") %></label>
<div class="col-sm-8">
<input type="checkbox" name="active" value="true" <%= @profile.profile.active ? "checked" : "" %> />
</div>
</div>
<label class="col-sm-2 control-label"><%= t("recruitment.search_active") %></label>
<div class="col-sm-8">
<input type="checkbox" name="active" value="true" <%= @profile.profile.active ? "checked" : "" %> />
</div>
</div>
<% end %>
<div class="form-group">
<label for="password" class="col-sm-2 control-label"><%= t("pseudo_members.password") %></label>
<div class="col-sm-4">