Skip to content

Instantly share code, notes, and snippets.

@sirmxanot
Created February 29, 2012 16:56
Show Gist options
  • Save sirmxanot/1942441 to your computer and use it in GitHub Desktop.
Save sirmxanot/1942441 to your computer and use it in GitHub Desktop.
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