Skip to content

Commit

Permalink
fixed the redirect bug in transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrobert committed Jun 23, 2020
1 parent e045b4f commit f04a8bc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/controllers/transactions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,15 @@ def edit
def update
@transaction = current_user.transactions.find(params[:id])
if @transaction.update(transaction_params)

if @transaction.group_id.nil?

redirect_to transactions_path, notice: 'transaction was successfully updated.'
redirect_to external_path, notice: 'external transaction was successfully updated.'
else
redirect_to transactions_path, notice: 'transaction was successfully updated.'
end


else
render :edit
end
Expand Down

0 comments on commit f04a8bc

Please sign in to comment.