summaryrefslogtreecommitdiffstats
path: root/app/controllers/issue_categories_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-11 17:51:30 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-11 17:51:30 +0000
commit0b9609468094fdb99ea9e0b68677dd178f85538c (patch)
tree736718d4e4684810e593863cfa051ac1a6a68251 /app/controllers/issue_categories_controller.rb
parentcf66561b1ef5f80360588bc4e4691bf464cd88fc (diff)
downloadredmine-0b9609468094fdb99ea9e0b68677dd178f85538c.tar.gz
redmine-0b9609468094fdb99ea9e0b68677dd178f85538c.zip
Use named routes in controllers.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10981 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issue_categories_controller.rb')
-rw-r--r--app/controllers/issue_categories_controller.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/app/controllers/issue_categories_controller.rb b/app/controllers/issue_categories_controller.rb
index 89afde13d..e7faba6f7 100644
--- a/app/controllers/issue_categories_controller.rb
+++ b/app/controllers/issue_categories_controller.rb
@@ -26,14 +26,14 @@ class IssueCategoriesController < ApplicationController
def index
respond_to do |format|
- format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project }
+ format.html { redirect_to_settings_in_projects }
format.api { @categories = @project.issue_categories.all }
end
end
def show
respond_to do |format|
- format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project }
+ format.html { redirect_to_settings_in_projects }
format.api
end
end
@@ -55,7 +55,7 @@ class IssueCategoriesController < ApplicationController
respond_to do |format|
format.html do
flash[:notice] = l(:notice_successful_create)
- redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
+ redirect_to_settings_in_projects
end
format.js
format.api { render :action => 'show', :status => :created, :location => issue_category_path(@category) }
@@ -78,7 +78,7 @@ class IssueCategoriesController < ApplicationController
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
- redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
+ redirect_to_settings_in_projects
}
format.api { render_api_ok }
end
@@ -99,7 +99,7 @@ class IssueCategoriesController < ApplicationController
end
@category.destroy(reassign_to)
respond_to do |format|
- format.html { redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'categories' }
+ format.html { redirect_to_settings_in_projects }
format.api { render_api_ok }
end
return
@@ -107,7 +107,12 @@ class IssueCategoriesController < ApplicationController
@categories = @project.issue_categories - [@category]
end
-private
+ private
+
+ def redirect_to_settings_in_projects
+ redirect_to settings_project_path(@project, :tab => 'categories')
+ end
+
# Wrap ApplicationController's find_model_object method to set
# @category instead of just @issue_category
def find_model_object