Created
February 29, 2012 16:56
-
-
Save sirmxanot/1942441 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def destroy | |
@user = User.find(params[:id]) | |
if @user.id == current_user.id | |
@user.destroy | |
flash[:success] = "You have successfully deleted your account." | |
else | |
flash[:error] = "You can't delete other users." | |
end | |
redirect_to users_url | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment