Skip to content

Commit

Permalink
TTPLAT-622 fix redirect after asset destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
mathmerized committed Dec 28, 2018
1 parent c44bc48 commit b59e654
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/assets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def destroy

# make sure we can find the asset we are supposed to be removing and that it belongs to us.
if @asset.nil?
redirect_to(inventory_index_url, :flash => { :alert => t(:error_404) })
redirect_to(root_path, :flash => { :alert => t(:error_404) })
return
end

Expand All @@ -475,7 +475,7 @@ def destroy
notify_user(:notice, "Asset was successfully removed.")

respond_to do |format|
format.html { redirect_to(inventory_index_url) }
format.html { redirect_to(inventory_index_url(Rails.application.config.asset_seed_class_name.foreign_key => @asset.send(Rails.application.config.asset_seed_class_name.foreign_key))) }
format.json { head :no_content }
end

Expand Down

0 comments on commit b59e654

Please sign in to comment.