1
0
Fork 0

Fix interface bug

This commit is contained in:
Alex Kotov 2019-02-01 08:43:26 +05:00
parent 6c66b38082
commit f31dca357c
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 8 additions and 2 deletions

View file

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

View file

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