Use named routes in controllers.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10983 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-12-11 19:39:47 +00:00
parent 60d06d8c17
commit 8ab9215ea8
22 changed files with 117 additions and 88 deletions
+8 -8
View File
@@ -59,7 +59,7 @@ class MyController < ApplicationController
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
set_language_if_valid @user.language
flash[:notice] = l(:notice_account_updated)
redirect_to :action => 'account'
redirect_to my_account_path
return
end
end
@@ -69,7 +69,7 @@ class MyController < ApplicationController
def destroy
@user = User.current
unless @user.own_account_deletable?
redirect_to :action => 'account'
redirect_to my_account_path
return
end
@@ -88,7 +88,7 @@ class MyController < ApplicationController
@user = User.current
unless @user.change_password_allowed?
flash[:error] = l(:notice_can_t_change_password)
redirect_to :action => 'account'
redirect_to my_account_path
return
end
if request.post?
@@ -96,7 +96,7 @@ class MyController < ApplicationController
@user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
if @user.save
flash[:notice] = l(:notice_account_password_updated)
redirect_to :action => 'account'
redirect_to my_account_path
end
else
flash[:error] = l(:notice_account_wrong_password)
@@ -114,7 +114,7 @@ class MyController < ApplicationController
User.current.rss_key
flash[:notice] = l(:notice_feeds_access_key_reseted)
end
redirect_to :action => 'account'
redirect_to my_account_path
end
# Create a new API key
@@ -127,7 +127,7 @@ class MyController < ApplicationController
User.current.api_key
flash[:notice] = l(:notice_api_access_key_reseted)
end
redirect_to :action => 'account'
redirect_to my_account_path
end
# User's page layout configuration
@@ -156,7 +156,7 @@ class MyController < ApplicationController
layout['top'].unshift block
@user.pref[:my_page_layout] = layout
@user.pref.save
redirect_to :action => 'page_layout'
redirect_to my_page_layout_path
end
# Remove a block to user's page
@@ -169,7 +169,7 @@ class MyController < ApplicationController
%w(top left right).each {|f| (layout[f] ||= []).delete block }
@user.pref[:my_page_layout] = layout
@user.pref.save
redirect_to :action => 'page_layout'
redirect_to my_page_layout_path
end
# Change blocks order on user's page