Refactor: move #destroy_comment method to CommentsController#destroy

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4172 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-09-23 15:20:19 +00:00
parent 4948121af0
commit 401197a895
8 changed files with 23 additions and 17 deletions
+6
View File
@@ -16,6 +16,12 @@ class CommentsController < ApplicationController
redirect_to :controller => 'news', :action => 'show', :id => @news
end
verify :method => :delete, :only => :destroy, :render => {:nothing => true, :status => :method_not_allowed }
def destroy
@news.comments.find(params[:comment_id]).destroy
redirect_to :controller => 'news', :action => 'show', :id => @news
end
private
# ApplicationController's find_model_object sets it based on the controller