From 1f6ac14296e3b99ecb43265344fac46f47f03ca5 Mon Sep 17 00:00:00 2001 From: hjust Date: Thu, 26 Nov 2009 23:19:10 +0000 Subject: [PATCH] Started to change the routes to match default Redmine behavior. git-svn-id: https://dev.finn.de/svn/cockpit/trunk@314 7926756e-e54e-46e6-9721-ed318f58905e --- config/routes.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 0909f05d0d..4e21ed28ed 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,22 @@ ActionController::Routing::Routes.draw do |map| - map.connect 'projects/:project_id/costlog/:action/:id', :controller => 'costlog', :project_id => /.+/ + map.connect 'cost_entries/:id/edit', :action => 'edit', :controller => 'costlog' + map.connect 'projects/:project_id/cost_entries/new', :action => 'edit', :controller => 'costlog' + map.connect 'projects/:project_id/issues/:issue_id/cost_entries/new', :action => 'edit', :controller => 'costlog' + + map.with_options :controller => 'costlog' do |costlog| + costlog.connect 'projects/:project_id/cost_entries', :action => 'details' + + costlog.with_options :action => 'details', :conditions => {:method => :get} do |cost_details| + cost_details.connect 'cost_entries' + cost_details.connect 'cost_entries.:format' + cost_details.connect 'issues/:issue_id/cost_entries' + cost_details.connect 'issues/:issue_id/cost_entries.:format' + cost_details.connect 'projects/:project_id/cost_entries.:format' + cost_details.connect 'projects/:project_id/issues/:issue_id/cost_entries' + cost_details.connect 'projects/:project_id/issues/:issue_id/cost_entries.:format' + end + end + map.connect 'projects/:project_id/cost_reports/:action/:id', :controller => 'cost_reports', :project_id => /.+/ map.connect 'projects/:project_id/cost_objects/:action/:id', :controller => 'cost_objects' map.connect 'projects/:project_id/hourly_rates/:action/:id', :controller => 'hourly_rates', :project_id => /.+/