From ea3578f2cc4fa476734325f9555377f9bb97238c Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Mon, 31 Dec 2007 16:50:05 +0000 Subject: [PATCH] ActionItem135: refactoring: extracting redirect to user initial page to a new method --- app/controllers/public/account_controller.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/public/account_controller.rb b/app/controllers/public/account_controller.rb index 583f0e0..97b4a17 100644 --- a/app/controllers/public/account_controller.rb +++ b/app/controllers/public/account_controller.rb @@ -21,7 +21,7 @@ class AccountController < PublicController self.current_user.remember_me cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at } end - redirect_back_or_default(myprofile_path(:controller => 'profile_editor', :profile => current_user.login)) + go_to_user_initial_page flash[:notice] = _("Logged in successfully") else flash[:notice] = _('Incorrect username or password') @@ -42,7 +42,7 @@ class AccountController < PublicController self.current_user = @user owner_role = Role.find_by_name('owner') @user.person.affiliate(@user.person, [owner_role]) if owner_role - redirect_back_or_default(myprofile_path(:controller => 'profile_editor', :profile => current_user.login)) + go_to_user_initial_page flash[:notice] = _("Thanks for signing up!") end rescue ActiveRecord::RecordInvalid @@ -126,4 +126,9 @@ class AccountController < PublicController def load_default_environment @environment = Environment.default end + + def go_to_user_initial_page + redirect_back_or_default(myprofile_path(:controller => 'profile_editor', :profile => current_user.login)) + end + end -- libgit2 0.21.2