Skip to content

Commit

Permalink
fix destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Sep 28, 2024
1 parent 2e6cdcd commit 8a6870b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/controllers/avo/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,19 @@ def resource_view_response_path
end

def destroy_success_action
flash[:notice] = destroy_success_message

respond_to do |format|
format.html { redirect_to after_destroy_path, notice: destroy_success_message }
format.turbo_stream { render turbo_stream: turbo_stream.turbo_frame_reload(params[:turbo_frame]) }
if params[:turbo_frame]
format.turbo_stream do
render turbo_stream: [
turbo_stream.turbo_frame_reload(params[:turbo_frame]),
turbo_stream.flash_alerts
]
end
else
format.html { redirect_to after_destroy_path }
end
end
end

Expand Down

0 comments on commit 8a6870b

Please sign in to comment.