summaryrefslogtreecommitdiffstats
path: root/app/controllers/members_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-11 19:39:47 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-11 19:39:47 +0000
commit8ab9215ea8df2216ccfacf272804811b05ab82c8 (patch)
treeac9ab871a1f9fc1a190cd6505ee08e8efacf8863 /app/controllers/members_controller.rb
parent60d06d8c17290f536cf76ffd4a75bdafe540aa9a (diff)
downloadredmine-8ab9215ea8df2216ccfacf272804811b05ab82c8.tar.gz
redmine-8ab9215ea8df2216ccfacf272804811b05ab82c8.zip
Use named routes in controllers.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10983 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/members_controller.rb')
-rw-r--r--app/controllers/members_controller.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb
index 520302c8c..c1f737dc9 100644
--- a/app/controllers/members_controller.rb
+++ b/app/controllers/members_controller.rb
@@ -63,7 +63,7 @@ class MembersController < ApplicationController
end
respond_to do |format|
- format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project }
+ format.html { redirect_to_settings_in_projects }
format.js { @members = members }
format.api {
@member = members.first
@@ -82,7 +82,7 @@ class MembersController < ApplicationController
end
saved = @member.save
respond_to do |format|
- format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project }
+ format.html { redirect_to_settings_in_projects }
format.js
format.api {
if saved
@@ -99,7 +99,7 @@ class MembersController < ApplicationController
@member.destroy
end
respond_to do |format|
- format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project }
+ format.html { redirect_to_settings_in_projects }
format.js
format.api {
if @member.destroyed?
@@ -115,4 +115,10 @@ class MembersController < ApplicationController
@principals = Principal.active.not_member_of(@project).like(params[:q]).all(:limit => 100)
render :layout => false
end
+
+ private
+
+ def redirect_to_settings_in_projects
+ redirect_to settings_project_path(@project, :tab => 'members')
+ end
end