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/users_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/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e6702a971..96c46fa36 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -101,10 +101,11 @@ class UsersController < ApplicationController respond_to do |format| format.html { flash[:notice] = l(:notice_user_successful_create, :id => view_context.link_to(@user.login, user_path(@user))) - redirect_to(params[:continue] ? - {:controller => 'users', :action => 'new'} : - {:controller => 'users', :action => 'edit', :id => @user} - ) + if params[:continue] + redirect_to new_user_path + else + redirect_to edit_user_path(@user) + end } format.api { render :action => 'show', :status => :created, :location => user_url(@user) } end @@ -171,7 +172,7 @@ class UsersController < ApplicationController def destroy @user.destroy respond_to do |format| - format.html { redirect_back_or_default(users_url) } + format.html { redirect_back_or_default(users_path) } format.api { render_api_ok } end end @@ -180,7 +181,7 @@ class UsersController < ApplicationController @membership = Member.edit_membership(params[:membership_id], params[:membership], @user) @membership.save respond_to do |format| - format.html { redirect_to :controller => 'users', :action => 'edit', :id => @user, :tab => 'memberships' } + format.html { redirect_to edit_user_path(@user, :tab => 'memberships') } format.js end end @@ -191,7 +192,7 @@ class UsersController < ApplicationController @membership.destroy end respond_to do |format| - format.html { redirect_to :controller => 'users', :action => 'edit', :id => @user, :tab => 'memberships' } + format.html { redirect_to edit_user_path(@user, :tab => 'memberships') } format.js end end |