summaryrefslogtreecommitdiffstats
path: root/app/controllers/projects_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-10 09:32:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-10 09:32:41 +0000
commit467503fd4b5ad2b9d03b0161f0b4d313f129d500 (patch)
treef9c600e5fbee5c91d0217d5a60d64488ef6996b4 /app/controllers/projects_controller.rb
parent7dc8cf93401e4f02d993c9aa58e0146b15a84bb9 (diff)
downloadredmine-467503fd4b5ad2b9d03b0161f0b4d313f129d500.tar.gz
redmine-467503fd4b5ad2b9d03b0161f0b4d313f129d500.zip
Changed ProjectsController#destroy to DELETE only.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8152 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r--app/controllers/projects_controller.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index c765556e9..189220dca 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -228,18 +228,15 @@ class ProjectsController < ApplicationController
redirect_to(url_for(:controller => 'admin', :action => 'projects', :status => params[:status]))
end
+ verify :method => :delete, :only => :destroy, :render => {:nothing => true, :status => :method_not_allowed }
# Delete @project
def destroy
@project_to_destroy = @project
- if request.get?
- # display confirmation view
- else
- if api_request? || params[:confirm]
- @project_to_destroy.destroy
- respond_to do |format|
- format.html { redirect_to :controller => 'admin', :action => 'projects' }
- format.api { head :ok }
- end
+ if api_request? || params[:confirm]
+ @project_to_destroy.destroy
+ respond_to do |format|
+ format.html { redirect_to :controller => 'admin', :action => 'projects' }
+ format.api { head :ok }
end
end
# hide project in layout