allow user accounts to be deleted

This commit is contained in:
Lee Lawlor
2014-03-13 20:04:31 -04:00
parent 847a513a94
commit f21dea069f
4 changed files with 62 additions and 43 deletions

View File

@ -3,6 +3,14 @@ class UsersController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => [:api_login]
before_filter :require_user, :only => [:show, :edit, :update, :edit_profile]
# delete account
def destroy
user = current_user
user.delete
flash[:notice] = t(:account_deleted)
redirect_to root_path
end
# allow login via api
def api_login
# get the user by login or email