Skip to content

Commit

Permalink
Rewrite callbacks for avoid using redirect_to :back (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksym authored and ymasiuk committed Mar 7, 2019
1 parent e504d98 commit afeb0e7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/deposits/coins_controller.rb
Expand Up @@ -27,7 +27,7 @@ def update
when 'collect_fee'
deposit.collect!
end
redirect_to :back, notice: t('admin.deposits.coins.update.notice')
redirect_to admin_deposit_index_path(currency.id)
end

private
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/withdraws/coins_controller.rb
Expand Up @@ -34,7 +34,7 @@ def update

def destroy
@withdraw.reject!
redirect_to :back, notice: t('admin.withdraws.coins.update.notice')
redirect_to admin_withdraw_path(currency.id, @withdraw.id)
end

private
Expand Down Expand Up @@ -64,15 +64,15 @@ def process!
@withdraw.accept!
@withdraw.process!
end
redirect_to :back, notice: t('admin.withdraws.coins.update.notice')
redirect_to admin_withdraw_path(currency.id, @withdraw.id)
end

def load!
@withdraw.transaction do
@withdraw.update!(txid: params.fetch(:txid))
@withdraw.load!
end
redirect_to :back, notice: t('admin.withdraws.coins.update.notice')
redirect_to admin_withdraw_path(currency.id, @withdraw.id)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/admin/withdraws/fiats_controller.rb
Expand Up @@ -30,12 +30,12 @@ def update
@withdraw.dispatch!
@withdraw.success!
end
redirect_to :back, notice: 'Withdraw successfully updated!'
redirect_to admin_withdraw_path(currency.id, @withdraw.id)
end

def destroy
@withdraw.reject!
redirect_to :back, notice: 'Withdraw successfully destroyed!'
redirect_to admin_withdraw_path(currency.id, @withdraw.id)
end
end
end
Expand Down

0 comments on commit afeb0e7

Please sign in to comment.