Fix interface bug
This commit is contained in:
parent
6c66b38082
commit
f31dca357c
2 changed files with 8 additions and 2 deletions
|
@ -1,6 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Settings::ProfilesController < ApplicationController
|
||||
before_action :set_account
|
||||
|
||||
# GET /settings/profile/edit
|
||||
def edit
|
||||
authorize %i[settings profile]
|
||||
|
@ -10,7 +12,7 @@ class Settings::ProfilesController < ApplicationController
|
|||
def update
|
||||
authorize %i[settings profile]
|
||||
|
||||
unless current_account.update account_attributes_for_update
|
||||
unless @account.update account_attributes_for_update
|
||||
return render :edit
|
||||
end
|
||||
|
||||
|
@ -19,6 +21,10 @@ class Settings::ProfilesController < ApplicationController
|
|||
|
||||
private
|
||||
|
||||
def set_account
|
||||
@account = current_account.clone&.reload
|
||||
end
|
||||
|
||||
def account_attributes_for_update
|
||||
params.require(:account).permit(
|
||||
policy(%i[settings profile]).permitted_attributes_for_update,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
<%= simple_form_for current_account, url: settings_profile_path do |f| %>
|
||||
<%= simple_form_for @account, url: settings_profile_path do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
|
|
Reference in a new issue