Merge branch 'ntu' of https://github.com/Rulingcom/orbit into ntu
* 'ntu' of https://github.com/Rulingcom/orbit: Preventing site default design being deleted.
This commit is contained in:
commit
34ed8ae39c
|
@ -94,7 +94,12 @@ class Admin::DesignsController < OrbitBackendController
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@design = Design.find(params[:id])
|
@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
|
redirect_to admin_designs_url
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Reference in New Issue