Refactor: convert VersionsController to a REST resource.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4097 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-09-17 15:55:08 +00:00
parent eb1f58f962
commit bd193a026d
6 changed files with 14 additions and 21 deletions
+2 -2
View File
@@ -103,7 +103,7 @@ class VersionsController < ApplicationController
end
def update
if request.post? && params[:version]
if request.put? && params[:version]
attributes = params[:version].dup
attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing'])
if @version.update_attributes(attributes)
@@ -114,7 +114,7 @@ class VersionsController < ApplicationController
end
def close_completed
if request.post?
if request.put?
@project.close_completed_versions
end
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project