diff options
author | elijah <elijah@riseup.net> | 2013-07-02 23:17:44 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-07-02 23:17:44 -0700 |
commit | 96206389a863f105bd0b37dcdb9d00b7c30d8b51 (patch) | |
tree | b79e91b2dbc9af76b2077c9b854791aac9720833 /users/app/controllers/email_aliases_controller.rb | |
parent | fbe23fc59814f0b27dbc1073c34f03a6d22cab99 (diff) |
users engine changes - rewrite of the views, separate email settings to a separate controller, make users_controller html only and v1/users_controller json only.
Diffstat (limited to 'users/app/controllers/email_aliases_controller.rb')
-rw-r--r-- | users/app/controllers/email_aliases_controller.rb | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/users/app/controllers/email_aliases_controller.rb b/users/app/controllers/email_aliases_controller.rb index 3b0d5ac..4628a7f 100644 --- a/users/app/controllers/email_aliases_controller.rb +++ b/users/app/controllers/email_aliases_controller.rb @@ -1,20 +1,12 @@ -class EmailAliasesController < ApplicationController - +class EmailAliasesController < UsersBaseController before_filter :fetch_user - respond_to :html - def destroy @alias = @user.email_aliases.delete(params[:id]) - @user.save - flash[:notice] = t(:email_alias_destroyed_successfully, :alias => @alias) - redirect_to edit_user_path(@user, :anchor => :email) + if @user.save + flash[:notice] = t(:email_alias_destroyed_successfully, :alias => bold(@alias)) + end + redirect_to edit_user_email_settings_path(@user) end - protected - - def fetch_user - @user = User.find_by_param(params[:user_id]) - access_denied unless admin? or (@user == current_user) - end end |