fix MR comments

This commit is contained in:
Bilal
2020-09-09 15:00:26 +03:00
parent 545d12f427
commit 057bdfe882
3 changed files with 8 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
class AccountLocksController < ApplicationController
class Admin::AccountLocksController < Admin::ApplicationController
before_action :set_account
def create
@@ -16,8 +16,8 @@ class AccountLocksController < ApplicationController
private
def set_account
if params[:id].present?
@account = Account.find(params[:id])
if params[:account_id].present?
@account = Account.find_by(slug: params[:account_id])
else
failure_redirect
end

View File

@@ -31,9 +31,9 @@
<%= link_to fa_icon("pencil", text: "Edit"), edit_admin_account_path(account), class: "dropdown-item" %>
<%= link_to fa_icon("arrow-right", text: "Account Managers"), account_auths_path({ account_id: account.id}), class: "dropdown-item" %>
<% if account.locked? %>
<%= link_to fa_icon("unlock", text: "Unlock Account"), [:account, :lock, id: account.id], method: :delete, class: "dropdown-item" %>
<%= link_to fa_icon("unlock", text: "Unlock Account"), [:admin, account, :lock], method: :delete, class: "dropdown-item" %>
<% else %>
<%= link_to fa_icon("lock", text: "Lock Account"), [:account, :lock, id: account.id], method: :post, class: "dropdown-item" %>
<%= link_to fa_icon("lock", text: "Lock Account"), [:admin, account, :lock], method: :post, class: "dropdown-item" %>
<% end %>
</div>
</div>