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 committed 2010-09-17 15:55:08 +00:00
1 parent eb1f58f962
commit bd193a026d
6 files changed
+14 -21

No files matched your search

+5 -12
View File
@@ -173,6 +173,9 @@ ActionController::Routing::Routes.draw do |map|
end
end
# For nice "roadmap" in the url for the index action
map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
map.resources :projects, :member => {
:copy => [:get, :post],
:settings => :get,
@@ -182,6 +185,7 @@ ActionController::Routing::Routes.draw do |map|
} do |project|
project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy]
project.resources :files, :only => [:index, :new, :create]
project.resources :versions, :collection => {:close_completed => :put}
end
# Destroy uses a get request to prompt the user before the actual DELETE request
@@ -201,19 +205,8 @@ ActionController::Routing::Routes.draw do |map|
activity.connect 'activity', :id => nil
activity.connect 'activity.:format', :id => nil
end
map.with_options :controller => 'versions' do |versions|
versions.connect 'projects/:project_id/versions/new', :action => 'new'
versions.connect 'projects/:project_id/roadmap', :action => 'index'
versions.connect 'versions/:action/:id', :conditions => {:method => :get}
versions.with_options :conditions => {:method => :post} do |version_actions|
version_actions.connect 'projects/:project_id/versions', :action => 'create'
version_actions.connect 'versions/update/:id', :action => 'update'
version_actions.connect 'projects/:project_id/versions/close_completed', :action => 'close_completed'
end
end
map.with_options :controller => 'issue_categories' do |categories|
categories.connect 'projects/:project_id/issue_categories/new', :action => 'new'
end