Refactor: convert timelogs to a REST resource (:time_entries)

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4250 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-10-12 15:55:21 +00:00
parent 71dd4b8a7d
commit 718816c5d4
5 changed files with 65 additions and 47 deletions
+1 -2
View File
@@ -20,8 +20,6 @@ class TimelogController < ApplicationController
before_filter :find_project, :authorize, :only => [:new, :create, :edit, :update, :destroy]
before_filter :find_optional_project, :only => [:index]
verify :method => :post, :only => :destroy, :redirect_to => { :action => :index }
helper :sort
include SortHelper
helper :issues
@@ -131,6 +129,7 @@ class TimelogController < ApplicationController
end
end
verify :method => :delete, :only => :destroy, :render => {:nothing => true, :status => :method_not_allowed }
def destroy
(render_404; return) unless @time_entry
(render_403; return) unless @time_entry.editable_by?(User.current)