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
This commit is contained in:
Dmitriy Zaporozhets 2014-09-11 06:45:52 +00:00
commit 17fd28468e

View file

@ -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