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 committed 2010-10-12 15:55:21 +00:00
1 parent 71dd4b8a7d
commit 718816c5d4
5 files changed
+65 -47

No files matched your search

+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)
+1 -1
View File
@@ -31,7 +31,7 @@
:title => l(:button_edit) %>
<%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry, :project_id => nil},
:confirm => l(:text_are_you_sure),
:method => :post,
:method => :delete,
:title => l(:button_delete) %>
<% end -%>
</td>