diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-11 19:39:47 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-11 19:39:47 +0000 |
commit | 8ab9215ea8df2216ccfacf272804811b05ab82c8 (patch) | |
tree | ac9ab871a1f9fc1a190cd6505ee08e8efacf8863 /app/controllers/members_controller.rb | |
parent | 60d06d8c17290f536cf76ffd4a75bdafe540aa9a (diff) | |
download | redmine-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.rb | 12 |
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 |