diff --git a/app/controllers/admin/designs_controller.rb b/app/controllers/admin/designs_controller.rb index 913520fa..a661a5c1 100644 --- a/app/controllers/admin/designs_controller.rb +++ b/app/controllers/admin/designs_controller.rb @@ -94,7 +94,12 @@ class Admin::DesignsController < OrbitBackendController def destroy @design = Design.find(params[:id]) - @design.destroy + if @site.design == @design + flash[:error] = "Failed! You can not delete a design that used by default " + else + @design.destroy + flash[:notice] = "Successfully deleted design." + end redirect_to admin_designs_url end