Commit 17fd2846 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'project-destroy-redirect' into 'master'

Redirect users to Projects Admin Page after removing a project

Fixes issue #543 by redirecting the user to "admin_projects_path" and displaying the flash alert "Project removed."

See merge request !178
parents d7ab859b 893bd8ac
......@@ -103,7 +103,15 @@ class ProjectsController < ApplicationController
::Projects::DestroyService.new(@project, current_user, {}).execute
respond_to do |format|
format.html { redirect_to root_path }
format.html do
flash[:alert] = "Project deleted."
if request.referer.include?("/admin")
redirect_to admin_projects_path
else
redirect_to projects_dashboard_path
end
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment