summaryrefslogtreecommitdiff
path: root/users/app/controllers
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-12-18 17:01:34 +0100
committerAzul <azul@leap.se>2012-12-18 17:01:34 +0100
commitdc827d0a80360aa245d4d724dc42bc47571faea6 (patch)
tree361b0be19535b0d7ddb3eaac7acdfcebc7a0e3a8 /users/app/controllers
parent42a76e82c8c1911f04a71244eea3ac07275367df (diff)
refactor: using tab partials for user editing
Diffstat (limited to 'users/app/controllers')
-rw-r--r--users/app/controllers/users_controller.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb
index 5c6767c..3d71c1a 100644
--- a/users/app/controllers/users_controller.rb
+++ b/users/app/controllers/users_controller.rb
@@ -3,6 +3,7 @@ class UsersController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => [:create]
before_filter :fetch_user, :only => [:edit, :update, :destroy]
+ before_filter :set_anchor, :only => [:edit, :update]
before_filter :authorize_admin, :only => [:index]
respond_to :json, :html
@@ -50,4 +51,13 @@ class UsersController < ApplicationController
@user = User.find_by_param(params[:id])
access_denied unless admin? or (@user == current_user)
end
+
+ def set_anchor
+ @anchor = email_settings? ? :email : :account
+ end
+
+ def email_settings?
+ params[:user] &&
+ params[:user].keys.detect{|key| key.index('email')}
+ end
end