summaryrefslogtreecommitdiff
path: root/users/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'users/app/controllers')
-rw-r--r--users/app/controllers/email_aliases_controller.rb (renamed from users/app/controllers/email_alias_controller.rb)7
1 files changed, 5 insertions, 2 deletions
diff --git a/users/app/controllers/email_alias_controller.rb b/users/app/controllers/email_aliases_controller.rb
index 979c8ad..751df85 100644
--- a/users/app/controllers/email_alias_controller.rb
+++ b/users/app/controllers/email_aliases_controller.rb
@@ -2,6 +2,8 @@ class EmailAliasesController < ApplicationController
before_filter :fetch_user
+ respond_to :html
+
# get a list of email aliases for the given user?
def index
@aliases = @user.email_aliases
@@ -11,20 +13,21 @@ class EmailAliasesController < ApplicationController
def create
@alias = @user.add_email_alias(params[:email_alias])
flash[:notice] = t(:email_alias_created_successfully) unless @alias.errors
- respond_with @alias
+ respond_with @alias, :location => edit_user_path(@user, :anchor => :email)
end
def update
@alias = @user.get_email_alias(params[:id])
@alias.set_email(params[:email_alias])
flash[:notice] = t(:email_alias_updated_successfully) unless @alias.errors
- respond_with @alias
+ respond_with @alias, :location => edit_user_path(@user, :anchor => :email)
end
def destroy
@alias = @user.get_email_alias(params[:id])
flash[:notice] = t(:email_alias_destroyed_successfully)
@alias.destroy
+ redirect_to edit_user_path(@user, :anchor => :email)
end
protected