Merge pull request #1202 from internetee/improve-registrar-area-account-view

Improve registrar area account view
This commit is contained in:
Timo Võhmar 2019-06-07 13:48:48 +03:00 committed by GitHub
commit 7b7a87348b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 137 additions and 56 deletions

View file

@ -0,0 +1,24 @@
class Registrar
class AccountController < BaseController
skip_authorization_check
def show; end
def edit
@registrar = current_registrar_user.registrar
end
def update
@registrar = current_registrar_user.registrar
@registrar.update!(registrar_params)
redirect_to registrar_account_path, notice: t('.saved')
end
private
def registrar_params
params.require(:registrar).permit(:billing_email)
end
end
end

View file

@ -1,17 +0,0 @@
class Registrar
class ProfileController < BaseController
skip_authorization_check
helper_method :linked_users
def show
@user = current_registrar_user
end
private
def linked_users
current_registrar_user.linked_users
end
end
end

View file

@ -182,7 +182,7 @@ class Registrar
if can?(:show, :poll)
registrar_root_path
else
registrar_profile_path
registrar_account_path
end
end