Skip to content

Commit

Permalink
change redirect option after domain creation
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Mar 15, 2024
1 parent d3db46b commit 3db8895
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/controllers/registrant/domains_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ def create
@invoice = pending.create_invoice_by_pending_action(domain_price.price.to_f)

if @invoice
flash.now[:notice] = t('.success')
flash[:notice] = t('.success')

render turbo_stream: [
turbo_stream.append('flash', partial: 'layouts/flash'),
turbo_stream.append('payment_method', partial: 'registrant/domains/payment_form',
locals: { invoice: @invoice})
]
redirect_to registrant_domains_path, status: :see_other

# render turbo_stream: [
# turbo_stream.append('flash', partial: 'layouts/flash'),
# turbo_stream.append('payment_method', partial: 'registrant/domains/payment_form',
# locals: { invoice: @invoice})
# ]
else
flash[:alert] = @invoice.errors.full_messages
render turbo_stream: turbo_stream.replace('flash', partial: 'layouts/flash')
Expand Down

0 comments on commit 3db8895

Please sign in to comment.